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>
Tue, 17 Dec 2019 19:37:20 +0000 (20:37 +0100)
commitec85bb89cc74a60c1afb47f537f9613b795a184a
tree91f82ceaf19e533b38f41f061db2af9523642f07
parent4f3836c8aee27c43fd26af7d05e214ea4fe1d67e
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