]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
llc: fix netdevice reference leaks in llc_ui_bind()
authorEric Dumazet <edumazet@google.com>
Wed, 23 Mar 2022 00:41:47 +0000 (17:41 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 28 Mar 2022 06:41:43 +0000 (08:41 +0200)
commitd14193111c436fc5de33206c67c7afd45c730099
tree8bbf090c473796a0316bf4f6f952310e2454e27d
parentc3fa6d1937a8d0828131a04ae2cd2c30d0668693
llc: fix netdevice reference leaks in llc_ui_bind()

commit 764f4eb6846f5475f1244767d24d25dd86528a4a upstream.

Whenever llc_ui_bind() and/or llc_ui_autobind()
took a reference on a netdevice but subsequently fail,
they must properly release their reference
or risk the infamous message from unregister_netdevice()
at device dismantle.

unregister_netdevice: waiting for eth0 to become free. Usage count = 3

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: 赵子轩 <beraphin@gmail.com>
Reported-by: Stoyan Manolov <smanolov@suse.de>
Link: https://lore.kernel.org/r/20220323004147.1990845-1-eric.dumazet@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/llc/af_llc.c