This bug is still there in linux-next.  What's the story, Andreas?

regards,
dan carpenter

On Thu, Jan 23, 2014 at 07:19:57PM +0300, Dan Carpenter wrote:
> Hello Andreas Larsson,
> 
> The patch 27e9dcc924e9: "usb: gadget: Add UDC driver for Aeroflex
> Gaisler GRUSBDC" from Dec 23, 2013, leads to the following static
> checker warning:
> 
>       drivers/usb/gadget/gr_udc.c:1994 gr_ep_init()
>       error: scheduling with locks held: 'spin_lock:lock'
> 
> drivers/usb/gadget/gr_udc.c
>   1991          INIT_LIST_HEAD(&ep->queue);
>   1992  
>   1993          if (num == 0) {
>   1994                  _req = gr_alloc_request(&ep->ep, GFP_KERNEL);
>                                                          ^^^^^^^^^^
> GFP_ATOMIC?
> 
>   1995                  buf = devm_kzalloc(dev->dev, PAGE_SIZE, GFP_DMA | 
> GFP_KERNEL);
>                                                                 
> ^^^^^^^^^^^^^^^^^^^^
> This allocation can sleep as well.  We're not allowed to sleep if we're
> holding a spinlock.
> 
>   1996                  if (!_req || !buf) {
>   1997                          /* possible _req freed by gr_probe via 
> gr_remove */
>   1998                          return -ENOMEM;
>   1999                  }
>   2000  
>   2001                  req = container_of(_req, struct gr_request, req);
>   2002                  req->req.buf = buf;
>   2003                  req->req.length = MAX_CTRL_PL_SIZE;
> 
> The call tree is:
>   gr_probe() <- takes the spinlock
>   -> gr_udc_init()
>      -> gr_ep_init()  <-- sleeps
> 
> regards,
> dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to