aboutsummaryrefslogtreecommitdiffstats
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
parentee47ad42c5868ffad569a94dd680f7ae79de2fb9 (diff)
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>
-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,
958 struct vnet *vp = netdev_priv(dev); 958 struct vnet *vp = netdev_priv(dev);
959 struct vnet_port *port = __tx_port_find(vp, skb); 959 struct vnet_port *port = __tx_port_find(vp, skb);
960 960
961 if (port == NULL)
962 return 0;
961 return port->q_index; 963 return port->q_index;
962} 964}
963 965