]> git.baikalelectronics.ru Git - kernel.git/commit
net: hso: fix muxed tty registration
authorJohan Hovold <johan@kernel.org>
Fri, 17 Sep 2021 10:12:04 +0000 (12:12 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 17 Sep 2021 10:19:58 +0000 (11:19 +0100)
commit5c8f72ba58fddd3f1c389f6d6f627e73e49ac52b
tree227611cd50cddf3faa10caa0a522ecd55643304d
parenta00c605b8ff64244c4a3c24785f25b877bda7335
net: hso: fix muxed tty registration

If resource allocation and registration fail for a muxed tty device
(e.g. if there are no more minor numbers) the driver should not try to
deregister the never-registered (or already-deregistered) tty.

Fix up the error handling to avoid dereferencing a NULL pointer when
attempting to remove the character device.

Fixes: a3f20b1d831b ("HSO: add option hso driver")
Cc: stable@vger.kernel.org # 2.6.27
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/usb/hso.c