diff options
Diffstat (limited to 'drivers/net/ifb.c')
-rw-r--r-- | drivers/net/ifb.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/ifb.c b/drivers/net/ifb.c index 030913f8bd26..69c25668dd63 100644 --- a/drivers/net/ifb.c +++ b/drivers/net/ifb.c | |||
@@ -98,13 +98,15 @@ static void ri_tasklet(unsigned long dev) | |||
98 | stats->tx_packets++; | 98 | stats->tx_packets++; |
99 | stats->tx_bytes +=skb->len; | 99 | stats->tx_bytes +=skb->len; |
100 | 100 | ||
101 | skb->dev = dev_get_by_index(&init_net, skb->iif); | 101 | rcu_read_lock(); |
102 | skb->dev = dev_get_by_index_rcu(&init_net, skb->iif); | ||
102 | if (!skb->dev) { | 103 | if (!skb->dev) { |
104 | rcu_read_unlock(); | ||
103 | dev_kfree_skb(skb); | 105 | dev_kfree_skb(skb); |
104 | stats->tx_dropped++; | 106 | stats->tx_dropped++; |
105 | break; | 107 | break; |
106 | } | 108 | } |
107 | dev_put(skb->dev); | 109 | rcu_read_unlock(); |
108 | skb->iif = _dev->ifindex; | 110 | skb->iif = _dev->ifindex; |
109 | 111 | ||
110 | if (from & AT_EGRESS) { | 112 | if (from & AT_EGRESS) { |