From: David L Stevens Date: Thu, 19 Feb 2015 18:15:49 +0000 (-0500) Subject: sunvnet: failed trigger should not cause BUG_ON() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=bb39b7433d1c652b3699a7b335e0ad91181b2b05;p=linux-beck.git sunvnet: failed trigger should not cause BUG_ON() An error return from __vnet_tx_trigger() sets the TX descriptor to VIO_DESC_FREE while leaving port->tx_bufs[txi].skb set. This leads to a BUG_ON() the next time this descriptor is used. This patch frees the pending skb when getting a trigger error to match the VIO_DESC_FREE state. Signed-off-by: David L Stevens Acked-by: Sowmini Varadhan Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/sun/sunvnet.c b/drivers/net/ethernet/sun/sunvnet.c index 22e0cad1b4b5..401abf7254d3 100644 --- a/drivers/net/ethernet/sun/sunvnet.c +++ b/drivers/net/ethernet/sun/sunvnet.c @@ -1411,6 +1411,8 @@ static int vnet_start_xmit(struct sk_buff *skb, struct net_device *dev) if (unlikely(err < 0)) { netdev_info(dev, "TX trigger error %d\n", err); d->hdr.state = VIO_DESC_FREE; + skb = port->tx_bufs[txi].skb; + port->tx_bufs[txi].skb = NULL; dev->stats.tx_carrier_errors++; goto out_dropped; }