USB: serial: console: fix use-after-free after failed setup
authorJohan Hovold <johan@kernel.org>
Wed, 4 Oct 2017 09:01:13 +0000 (11:01 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 2 Nov 2017 06:16:16 +0000 (07:16 +0100)
commitbe3e7b176c28cb919f81c3fa2ff63148be7a74e5
treec42e826777d2306122113363f9ea56646c277c7a
parentd75e8540fd8bedc8ee8d11941a7aed3a86735c47
USB: serial: console: fix use-after-free after failed setup

commit 299d7572e46f98534033a9e65973f13ad1ce9047 upstream.

Make sure to reset the USB-console port pointer when console setup fails
in order to avoid having the struct usb_serial be prematurely freed by
the console code when the device is later disconnected.

Fixes: 73e487fdb75f ("[PATCH] USB console: fix disconnection issues")
Cc: stable <stable@vger.kernel.org> # 2.6.18
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
drivers/usb/serial/console.c