]> git.baikalelectronics.ru Git - kernel.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)
committerDavid S. Miller <davem@davemloft.net>
Thu, 15 Jul 2021 19:36:21 +0000 (12:36 -0700)
commit78549b302e0d314244eb8b95ada220e2368cd308
tree9bbbdb515ab944442e815e2a425568f6ed4a8bb0
parent1cf4048bcd2b59790f5c63d64c9428548371c68f
usb: hso: fix error handling code of hso_create_net_device

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: 487731b0ac1f ("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>
drivers/net/usb/hso.c