mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
CAN: use dev_get_by_index_rcu
Use new function to avoid doing read_lock(). Signed-off-by: Stephen Hemminger <[email protected]> Acked-by: Eric Dumazet <[email protected]> Signed-off-by: Oliver Hartkopp <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
61fbab77a8
commit
ff879eb611
1 changed files with 3 additions and 3 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue