Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c647cc3f authored by David L Stevens's avatar David L Stevens Committed by David S. Miller
Browse files

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: default avatarDavid L Stevens <david.stevens@oracle.com>
Acked-by: default avatarSowmini Varadhan <sowmini.varadhan@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ee47ad42
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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;
}