OSDN Git Service

usb: gadget: u_serial: add missing port entry locking
authorMichał Mirosław <mirq-linux@rere.qmqm.pl>
Sat, 10 Aug 2019 08:42:48 +0000 (10:42 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 21 Dec 2019 09:34:19 +0000 (10:34 +0100)
commitf2278b83bbd6b49d1e0981f4ffbe51e18967bac0
tree52e41ee2f5c5bb62a2baffd56c1daa9ca03cc0f1
parent1b4ce5fca054b0f8f815d4a47cee03ced5d3481f
usb: gadget: u_serial: add missing port entry locking

commit daf82bd24e308c5a83758047aff1bd81edda4f11 upstream.

gserial_alloc_line() misses locking (for a release barrier) while
resetting port entry on TTY allocation failure. Fix this.

Cc: stable@vger.kernel.org
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Tested-by: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/function/u_serial.c