Skip to content
Commit 16b77695 authored by Ying Xue's avatar Ying Xue Committed by David S. Miller
Browse files

batman-adv: use __dev_get_by_index instead of dev_get_by_index to find interface



The following call chains indicate that batadv_is_on_batman_iface()
is always under rtnl_lock protection as call_netdevice_notifier()
is protected by rtnl_lock. So if __dev_get_by_index() rather than
dev_get_by_index() is used to find interface handler in it, this
would help us avoid to change interface reference counter.

call_netdevice_notifier()
  batadv_hard_if_event()
    batadv_hardif_add_interface()
      batadv_is_valid_iface()
        batadv_is_on_batman_iface()

Cc: Antonio Quartulli <antonio@meshcoding.com>
Signed-off-by: default avatarYing Xue <ying.xue@windriver.com>
Acked-by: default avatarAntonio Quartulli <antonio@meshcoding.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 73763949
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment