mirror of
https://github.com/torvalds/linux.git
synced 2024-11-19 10:31:48 +00:00
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
@ -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 New Issue
Block a user