Skip to content

Commit

Permalink
sunvnet: failed trigger should not cause BUG_ON()
Browse files Browse the repository at this point in the history
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 <david.stevens@oracle.com>
Acked-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David L Stevens authored and David S. Miller committed Feb 20, 2015
1 parent 950ddcb commit bb39b74
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/ethernet/sun/sunvnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit bb39b74

Please sign in to comment.