Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ff879eb6 authored by stephen hemminger's avatar stephen hemminger Committed by David S. Miller
Browse files

CAN: use dev_get_by_index_rcu



Use new function to avoid doing read_lock().

Signed-off-by: default avatarStephen Hemminger <shemminger@vyatta.com>
Acked-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: default avatarOliver Hartkopp <oliver@hartkopp.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 61fbab77
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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;
}