Commit 8652bcbf authored by Andreas Larsson's avatar Andreas Larsson Committed by Felipe Balbi

usb: gadget: gr_udc: Use GFP_ATOMIC when allocating under held spinlock

As gr_ep_init must be called with dev->lock held, GFP_KERNEL must not be used.
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarAndreas Larsson <andreas@gaisler.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent b38d27e5
...@@ -1990,8 +1990,8 @@ static int gr_ep_init(struct gr_udc *dev, int num, int is_in, u32 maxplimit) ...@@ -1990,8 +1990,8 @@ static int gr_ep_init(struct gr_udc *dev, int num, int is_in, u32 maxplimit)
INIT_LIST_HEAD(&ep->queue); INIT_LIST_HEAD(&ep->queue);
if (num == 0) { if (num == 0) {
_req = gr_alloc_request(&ep->ep, GFP_KERNEL); _req = gr_alloc_request(&ep->ep, GFP_ATOMIC);
buf = devm_kzalloc(dev->dev, PAGE_SIZE, GFP_DMA | GFP_KERNEL); buf = devm_kzalloc(dev->dev, PAGE_SIZE, GFP_DMA | GFP_ATOMIC);
if (!_req || !buf) { if (!_req || !buf) {
/* possible _req freed by gr_probe via gr_remove */ /* possible _req freed by gr_probe via gr_remove */
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment