提交 c647cc3f 编写于 作者: D David L Stevens 提交者: David S. Miller

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: NDavid L Stevens <david.stevens@oracle.com>
Acked-by: NSowmini Varadhan <sowmini.varadhan@oracle.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 ee47ad42
...@@ -958,6 +958,8 @@ vnet_select_queue(struct net_device *dev, struct sk_buff *skb, ...@@ -958,6 +958,8 @@ vnet_select_queue(struct net_device *dev, struct sk_buff *skb,
struct vnet *vp = netdev_priv(dev); struct vnet *vp = netdev_priv(dev);
struct vnet_port *port = __tx_port_find(vp, skb); struct vnet_port *port = __tx_port_find(vp, skb);
if (port == NULL)
return 0;
return port->q_index; return port->q_index;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册