diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2017-01-04 06:30:16 +0100 |
---|---|---|
committer | Felipe Balbi <felipe.balbi@linux.intel.com> | 2017-01-12 09:58:05 +0200 |
commit | 990758c53eafe5a220a780ed12e7b4d51b3df032 (patch) | |
tree | 54ceefeea393eaf6984212fd1e197ebef89cd459 /drivers/usb/gadget | |
parent | a121103c922847ba5010819a3f250f1f7fc84ab8 (diff) | |
download | linux-990758c53eafe5a220a780ed12e7b4d51b3df032.tar.bz2 |
usb: gadget: composite: Fix function used to free memory
'cdev->os_desc_req' has been allocated with 'usb_ep_alloc_request()' so
'usb_ep_free_request()' should be used to free it.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r-- | drivers/usb/gadget/composite.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c index 002822d98fda..49d685ad0da9 100644 --- a/drivers/usb/gadget/composite.c +++ b/drivers/usb/gadget/composite.c @@ -2147,7 +2147,7 @@ int composite_os_desc_req_prepare(struct usb_composite_dev *cdev, cdev->os_desc_req->buf = kmalloc(4096, GFP_KERNEL); if (!cdev->os_desc_req->buf) { ret = -ENOMEM; - kfree(cdev->os_desc_req); + usb_ep_free_request(ep0, cdev->os_desc_req); goto end; } cdev->os_desc_req->context = cdev; |