netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] caif-hsi: fix possible deadlock in cfhsi_exit_module()
@ 2019-07-15  5:10 Taehee Yoo
  2019-07-17 18:59 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Taehee Yoo @ 2019-07-15  5:10 UTC (permalink / raw)
  To: davem, netdev; +Cc: ap420073

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>
---
I did only compile test because I don't have the testbed.
Could anyone test this patch?
 drivers/net/caif/caif_hsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/caif/caif_hsi.c b/drivers/net/caif/caif_hsi.c
index b2f10b6ad6e5..bbb2575d4728 100644
--- a/drivers/net/caif/caif_hsi.c
+++ b/drivers/net/caif/caif_hsi.c
@@ -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();
 }
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] caif-hsi: fix possible deadlock in cfhsi_exit_module()
  2019-07-15  5:10 [PATCH net] caif-hsi: fix possible deadlock in cfhsi_exit_module() Taehee Yoo
@ 2019-07-17 18:59 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-07-17 18:59 UTC (permalink / raw)
  To: ap420073; +Cc: netdev

From: Taehee Yoo <ap420073@gmail.com>
Date: Mon, 15 Jul 2019 14:10:17 +0900

> 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>

Applied and queued up for -stable, thank you.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-07-17 18:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-15  5:10 [PATCH net] caif-hsi: fix possible deadlock in cfhsi_exit_module() Taehee Yoo
2019-07-17 18:59 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).