caif-hsi: fix possible deadlock in cfhsi_exit_module()
authorTaehee Yoo <ap420073@gmail.com>
Mon, 15 Jul 2019 05:10:17 +0000 (14:10 +0900)
committerDavid S. Miller <davem@davemloft.net>
Wed, 17 Jul 2019 18:58:56 +0000 (11:58 -0700)
cfhsi_exit_module() calls unregister_netdev() under rtnl_lock().
but unregister_netdev() internally calls rtnl_lock().
So deadlock would occur.

Fixes: c41254006377 ("caif-hsi: Add rtnl support")
Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/caif/caif_hsi.c

index b2f10b6ad6e5e3eedf2b505607d689b9edfefdcc..bbb2575d47287307d08ccc038456d1882ffa0228 100644 (file)
@@ -1455,7 +1455,7 @@ static void __exit cfhsi_exit_module(void)
        rtnl_lock();
        list_for_each_safe(list_node, n, &cfhsi_list) {
                cfhsi = list_entry(list_node, struct cfhsi, list);
-               unregister_netdev(cfhsi->ndev);
+               unregister_netdevice(cfhsi->ndev);
        }
        rtnl_unlock();
 }