USB: composite: Re-allocate bytes for IN endpoint
Switching to kzalloc doesn't mean we can't allocate some extra bytes for the TX buffer. This was simply an improper merge of commit [1] by CodeLinaro. The commit was just supposed to replace kmalloc with kzalloc. Therefore, add back the buffer allocation. [1]:ae9cf8b759("UPSTREAM: USB: gadget: zero allocate endpoint 0 buffers") Fixes:ae9cf8b759("UPSTREAM: USB: gadget: zero allocate endpoint 0 buffers") Change-Id: I97bcea8f9aed2d9a672b2f92b6cfd998f43b9d95 Signed-off-by: Tashfin Shakeer Rhythm <tashfinshakeerrhythm@gmail.com>
This commit is contained in:
committed by
Michael Bestas
parent
cb1b12dc85
commit
7d6808d57e
@@ -2340,7 +2340,8 @@ int composite_dev_prepare(struct usb_composite_driver *composite,
|
||||
if (!cdev->req)
|
||||
return -ENOMEM;
|
||||
|
||||
cdev->req->buf = kzalloc(USB_COMP_EP0_BUFSIZ, GFP_KERNEL);
|
||||
cdev->req->buf = kzalloc(USB_COMP_EP0_BUFSIZ +
|
||||
(gadget->extra_buf_alloc), GFP_KERNEL);
|
||||
if (!cdev->req->buf)
|
||||
goto fail;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user