]> git.baikalelectronics.ru Git - kernel.git/commit
usb: raw-gadget: fix raw_event_queue_fetch locking
authorAndrey Konovalov <andreyknvl@google.com>
Tue, 7 Apr 2020 14:47:54 +0000 (16:47 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 16 Apr 2020 12:52:14 +0000 (14:52 +0200)
commitab150506d470104d47e295db73664731ea6e2840
tree0776ad4bac82d93fdf3aa428f13b289d84cea04b
parent53de1daf8d1c31a268c71cbd98d915b605b1b48b
usb: raw-gadget: fix raw_event_queue_fetch locking

If queue->size check in raw_event_queue_fetch() fails (which normally
shouldn't happen, that check is a fail-safe), the function returns
without reenabling interrupts. This patch fixes that issue, along with
propagating the cause of failure to the function caller.

Fixes: 442790091f05 ("usb: gadget: add raw-gadget interface")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Link: https://lore.kernel.org/r/9f7ce7a1472cfb9447f6c5a494186fa1f2670f6f.1586270396.git.andreyknvl@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/legacy/raw_gadget.c