Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 990758c5 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Felipe Balbi
Browse files

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: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent a121103c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;