net: rose: fix netdev reference changes
stable inclusion from stable-v5.10.137 commit 9a070a4417660f0a2d01ee85a9914b342b0a7af8 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I60PLB Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=9a070a4417660f0a2d01ee85a9914b342b0a7af8 -------------------------------- [ Upstream commit 93102782 ] Bernard reported that trying to unload rose module would lead to infamous messages: unregistered_netdevice: waiting for rose0 to become free. Usage count = xx This patch solves the issue, by making sure each socket referring to a netdevice holds a reference count on it, and properly releases it in rose_release(). rose_dev_first() is also fixed to take a device reference before leaving the rcu_read_locked section. Following patch will add ref_tracker annotations to ease future bug hunting. Fixes: 1da177e4 ("Linux-2.6.12-rc2") Reported-by:Bernard Pidoux <f6bvp@free.fr> Signed-off-by:
Eric Dumazet <edumazet@google.com> Tested-by:
Bernard Pidoux <f6bvp@free.fr> Signed-off-by:
Jakub Kicinski <kuba@kernel.org> Signed-off-by:
Sasha Levin <sashal@kernel.org> Signed-off-by:
Zheng Zengkai <zhengzengkai@huawei.com> Reviewed-by:
Wei Li <liwei391@huawei.com>
Loading
Please sign in to comment