usb: gadget: Add missing annotation for xudc_handle_setup()
authorJules Irenge <jbi.octave@gmail.com>
Wed, 29 Apr 2020 10:05:23 +0000 (11:05 +0100)
committerFelipe Balbi <balbi@kernel.org>
Mon, 25 May 2020 08:09:40 +0000 (11:09 +0300)
Sparse reports a warning at xudc_handle_setup()

warning: context imbalance in xudc_handle_setup() - unexpected unlock

The root cause is the missing annotation at xudc_handle_setup()

Add the missing __must_hold(&udc->lock) annotation

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
drivers/usb/gadget/udc/udc-xilinx.c

index b1cfc8279c3d2d00c3ee594011124e8dd46735ba..709553bdb23397a2a7647f85b53dbf854bb9853c 100644 (file)
@@ -1732,6 +1732,7 @@ static void xudc_set_clear_feature(struct xusb_udc *udc)
  * Process setup packet and delegate to gadget layer.
  */
 static void xudc_handle_setup(struct xusb_udc *udc)
+       __must_hold(&udc->lock)
 {
        struct xusb_ep *ep0 = &udc->ep[0];
        struct usb_ctrlrequest setup;