]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: hso: fix error handling code of hso_create_net_device
authorDongliang Mu <mudongliangabcd@gmail.com>
Wed, 14 Jul 2021 09:13:22 +0000 (17:13 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Oct 2021 13:31:27 +0000 (15:31 +0200)
commitf6cf22a1ef49f8e131f99c3f5fd80ab6b23a2d21
treeadcc6b1adebec2708131da4ec287d786748ca64c
parent13f176b7eeaa4e4b4014facf147d998e858a23b5
usb: hso: fix error handling code of hso_create_net_device

commit a6ecfb39ba9d7316057cea823b196b734f6b18ca upstream.

The current error handling code of hso_create_net_device is
hso_free_net_device, no matter which errors lead to. For example,
WARNING in hso_free_net_device [1].

Fix this by refactoring the error handling code of
hso_create_net_device by handling different errors by different code.

[1] https://syzkaller.appspot.com/bug?id=66eff8d49af1b28370ad342787413e35bbe76efe

Reported-by: syzbot+44d53c7255bb1aea22d2@syzkaller.appspotmail.com
Fixes: 5fcfb6d0bfcd ("hso: fix bailout in error case of probe")
Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/usb/hso.c