usb: gadget: function: printer: Fix a memory leak for interface descriptor
PATCH v2 1/1 usb: gadget: function: printer: Fix a memory leak for interface descriptor
From: Zqiang <[email protected]>
When printer driver is loaded, the printer_func_bind function is called, in this function, the interface descriptor be allocated memory, if after that, the error occurred, the interface descriptor memory need to be free.
Reviewed-by Peter Chen <[email protected]>
Cc <[email protected]>
Signed-off-by Zqiang <[email protected]>
---
v1->v2:
Modify description information and add tags.
drivers/usb/gadget/function/f_printer.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/gadget/function/f_printer.c +1 -0
@@ -1162,6 +1162,7 @@ static int printer_func_bind(struct usb_configuration *c,printer_req_free (dev->in_ep, req); } +usb_free_all_descriptors (f);return ret; }
Signature · 1 line
2.17.1