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:
David L Stevens 2014-11-12 10:58:47 -05:00 committed by David S. Miller
parent ee47ad42c5
commit c647cc3fd5
1 changed files with 2 additions and 0 deletions

View File

@ -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;
}