aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/zero.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/gadget/zero.c')
-rw-r--r--drivers/usb/gadget/zero.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/usb/gadget/zero.c b/drivers/usb/gadget/zero.c
index 7078374d0b79..a2e6e3fc8c8d 100644
--- a/drivers/usb/gadget/zero.c
+++ b/drivers/usb/gadget/zero.c
@@ -481,8 +481,7 @@ alloc_ep_req (struct usb_ep *ep, unsigned length)
481 req = usb_ep_alloc_request (ep, GFP_ATOMIC); 481 req = usb_ep_alloc_request (ep, GFP_ATOMIC);
482 if (req) { 482 if (req) {
483 req->length = length; 483 req->length = length;
484 req->buf = usb_ep_alloc_buffer (ep, length, 484 req->buf = kmalloc(length, GFP_ATOMIC);
485 &req->dma, GFP_ATOMIC);
486 if (!req->buf) { 485 if (!req->buf) {
487 usb_ep_free_request (ep, req); 486 usb_ep_free_request (ep, req);
488 req = NULL; 487 req = NULL;
@@ -493,8 +492,7 @@ alloc_ep_req (struct usb_ep *ep, unsigned length)
493 492
494static void free_ep_req (struct usb_ep *ep, struct usb_request *req) 493static void free_ep_req (struct usb_ep *ep, struct usb_request *req)
495{ 494{
496 if (req->buf) 495 kfree(req->buf);
497 usb_ep_free_buffer (ep, req->buf, req->dma, req->length);
498 usb_ep_free_request (ep, req); 496 usb_ep_free_request (ep, req);
499} 497}
500 498
@@ -1199,8 +1197,7 @@ autoconf_fail:
1199 dev->req = usb_ep_alloc_request (gadget->ep0, GFP_KERNEL); 1197 dev->req = usb_ep_alloc_request (gadget->ep0, GFP_KERNEL);
1200 if (!dev->req) 1198 if (!dev->req)
1201 goto enomem; 1199 goto enomem;
1202 dev->req->buf = usb_ep_alloc_buffer (gadget->ep0, USB_BUFSIZ, 1200 dev->req->buf = kmalloc(USB_BUFSIZ, GFP_KERNEL);
1203 &dev->req->dma, GFP_KERNEL);
1204 if (!dev->req->buf) 1201 if (!dev->req->buf)
1205 goto enomem; 1202 goto enomem;
1206 1203