]> 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)
committerFelipe Balbi <balbi@kernel.org>
Fri, 17 Apr 2020 09:23:19 +0000 (12:23 +0300)
commit5e2afda43e18d021b11dee8efb63a98c4a5b89b5
tree63ba35fa3ea68451bc452c5e85b3454026931033
parent497e94e05f4835bae0d9a0901f17e48c5e788c85
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>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
drivers/usb/gadget/legacy/raw_gadget.c