sunvnet: fix NULL pointer dereference
This patch fixes a NULL pointer dereference when __tx_port_find() doesn't find a matching port. Signed-off-by: David L Stevens <david.stevens@oracle.com> Acked-by: Sowmini Varadhan <sowmini.varadhan@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
ee47ad42c5
commit
c647cc3fd5
1 changed files with 2 additions and 0 deletions
|
@ -958,6 +958,8 @@ vnet_select_queue(struct net_device *dev, struct sk_buff *skb,
|
|||
struct vnet *vp = netdev_priv(dev);
|
||||
struct vnet_port *port = __tx_port_find(vp, skb);
|
||||
|
||||
if (port == NULL)
|
||||
return 0;
|
||||
return port->q_index;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue