]> git.itanic.dy.fi Git - linux-stable/commit
ipack: ipoctal: fix tty-registration error handling
authorJohan Hovold <johan@kernel.org>
Fri, 17 Sep 2021 11:46:19 +0000 (13:46 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Oct 2021 13:56:00 +0000 (15:56 +0200)
commit67d1df661088b70382cd2499945ad80333c16ba1
treeb53edff782618ee43815a41645b7c01f1193c26a
parentf46e5db92fa2c28724724a39f1f51e8ca6a78de9
ipack: ipoctal: fix tty-registration error handling

commit cd20d59291d1790dc74248476e928f57fc455189 upstream.

Registration of the ipoctal tty devices is unlikely to fail, but if it
ever does, make sure not to deregister a never registered tty device
(and dereference a NULL pointer) when the driver is later unbound.

Fixes: 2afb41d9d30d ("Staging: ipack/devices/ipoctal: Check tty_register_device return value.")
Cc: stable@vger.kernel.org # 3.7
Acked-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20210917114622.5412-4-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/ipack/devices/ipoctal.c