summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
authorDavid L Stevens <david.stevens@oracle.com>2014-11-12 10:58:47 -0500
committerDavid S. Miller <davem@davemloft.net>2014-11-12 13:51:23 -0500
commitc647cc3fd5ee3c3aba34a00326e684684d491de0 (patch)
treea7a21ca9361c4094b2e4ed70e6686024ac2ae3a7 /drivers/net/ethernet
parentee47ad42c5868ffad569a94dd680f7ae79de2fb9 (diff)
downloadlinux-c647cc3fd5ee3c3aba34a00326e684684d491de0.tar.bz2
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>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r--drivers/net/ethernet/sun/sunvnet.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/sun/sunvnet.c b/drivers/net/ethernet/sun/sunvnet.c
index 55d66c9a6627..a556eba8eeed 100644
--- a/drivers/net/ethernet/sun/sunvnet.c
+++ b/drivers/net/ethernet/sun/sunvnet.c
@@ -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;
}