Skip to content

Commit

Permalink
CAN: use dev_get_by_index_rcu
Browse files Browse the repository at this point in the history
Use new function to avoid doing read_lock().

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Oliver Hartkopp <oliver@hartkopp.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
stephen hemminger authored and David S. Miller committed Nov 11, 2009
1 parent 61fbab7 commit ff879eb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions net/can/bcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,13 @@ static char *bcm_proc_getifname(char *result, int ifindex)
if (!ifindex)
return "any";

read_lock(&dev_base_lock);
dev = __dev_get_by_index(&init_net, ifindex);
rcu_read_lock();
dev = dev_get_by_index_rcu(&init_net, ifindex);
if (dev)
strcpy(result, dev->name);
else
strcpy(result, "???");
read_unlock(&dev_base_lock);
rcu_read_unlock();

return result;
}
Expand Down

0 comments on commit ff879eb

Please sign in to comment.