Skip to content

Commit

Permalink
ifb: should not use __dev_get_by_index() without locks
Browse files Browse the repository at this point in the history
At this point (ri_tasklet()), RTNL or dev_base_lock are not held,
we must use dev_get_by_index() instead of __dev_get_by_index()

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Oct 23, 2009
1 parent bc36b42 commit db51914
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/ifb.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,13 @@ static void ri_tasklet(unsigned long dev)
stats->tx_packets++;
stats->tx_bytes +=skb->len;

skb->dev = __dev_get_by_index(&init_net, skb->iif);
skb->dev = dev_get_by_index(&init_net, skb->iif);
if (!skb->dev) {
dev_kfree_skb(skb);
stats->tx_dropped++;
break;
}
dev_put(skb->dev);
skb->iif = _dev->ifindex;

if (from & AT_EGRESS) {
Expand Down

0 comments on commit db51914

Please sign in to comment.