Skip to content

Commit

Permalink
net: fix network drivers ndo_start_xmit() return values (part 8)
Browse files Browse the repository at this point in the history
Fix up USB drivers that return an errno value (result of usb_submit_urb())
to qdisc_restart(), causing qdisc_restart() to print a warning and requeue/
retransmit the skb.

- hso: skb is freed: use after free
- at76_usb: skb is freed: use after free

Compile tested only.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Patrick McHardy authored and David S. Miller committed Jun 13, 2009
1 parent 81fbbf6 commit 5b2c4b9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion drivers/net/usb/hso.c
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ static int hso_net_start_xmit(struct sk_buff *skb, struct net_device *net)
}
dev_kfree_skb(skb);
/* we're done */
return result;
return NETDEV_TX_OK;
}

static void hso_get_drvinfo(struct net_device *net, struct ethtool_drvinfo *info)
Expand Down
7 changes: 3 additions & 4 deletions drivers/staging/at76_usb/at76_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -3242,12 +3242,11 @@ static int at76_tx(struct sk_buff *skb, struct net_device *netdev)
"%s: -EINVAL: tx urb %p hcpriv %p complete %p\n",
priv->netdev->name, priv->tx_urb,
priv->tx_urb->hcpriv, priv->tx_urb->complete);
} else {
} else
stats->tx_bytes += skb->len;
dev_kfree_skb(skb);
}

return ret;
dev_kfree_skb(skb);
return NETDEV_TX_OK;
}

static void at76_tx_timeout(struct net_device *netdev)
Expand Down

0 comments on commit 5b2c4b9

Please sign in to comment.