]> git.baikalelectronics.ru Git - kernel.git/commit
USB: serial: console: move mutex_unlock() before usb_serial_put()
authorLiang He <windhl@126.com>
Mon, 19 Sep 2022 10:48:24 +0000 (18:48 +0800)
committerJohan Hovold <johan@kernel.org>
Mon, 19 Sep 2022 13:30:16 +0000 (15:30 +0200)
commit2f34c20e8ea750936a7d47886384c7480186e575
tree13bd4584403350ae7845faf4bd515a2beeb45246
parent2b466b4a5711cdfd69d04b940507538811966326
USB: serial: console: move mutex_unlock() before usb_serial_put()

While in current version there is no use-after-free as USB serial
core holds another reference when the console is registered, we
should better unlock before dropping the reference in
usb_console_setup().

Fixes: 9e1d3df8778d ("USB serial: update the console driver")
Signed-off-by: Liang He <windhl@126.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
drivers/usb/serial/console.c