]> git.proxmox.com Git - mirror_ubuntu-focal-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)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 5 Nov 2021 08:12:42 +0000 (09:12 +0100)
commite8028f2681d4229d4aec426fa61d86163c96ee24
tree0628dec1ef39576c7ec4ccf10eb1f34a64e59148
parent89253c55792fb3ccfd46b8f7e99cb02637027ded
net: hso: fix muxed tty registration

BugLink: https://bugs.launchpad.net/bugs/1947886
commit e8f69b16ee776da88589b5271e3f46020efc8f6c upstream.

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: 72dc1c096c70 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/net/usb/hso.c