diff options
author | David L Stevens <david.stevens@oracle.com> | 2014-11-12 10:58:47 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-11-12 13:51:23 -0500 |
commit | c647cc3fd5ee3c3aba34a00326e684684d491de0 (patch) | |
tree | a7a21ca9361c4094b2e4ed70e6686024ac2ae3a7 | |
parent | ee47ad42c5868ffad569a94dd680f7ae79de2fb9 (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.c | 2 |
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 | ||