[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20201014082850.16838-1-qiang.zhang@windriver.com>
Date: Wed, 14 Oct 2020 16:28:50 +0800
From: qiang.zhang@...driver.com
To: balbi@...nel.org, gregkh@...uxfoundation.org
Cc: linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] usb: gadget: function: printer: Fix usb function descriptors leak
From: Zqiang <qiang.zhang@...driver.com>
If an error occurs after call 'usb_assign_descriptors' func, the
'usb_free_all_descriptors' need to be call to release memory space
occupied by function descriptors.
Signed-off-by: Zqiang <qiang.zhang@...driver.com>
---
drivers/usb/gadget/function/f_printer.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/usb/gadget/function/f_printer.c b/drivers/usb/gadget/function/f_printer.c
index 64a4112068fc..2f1eb2e81d30 100644
--- a/drivers/usb/gadget/function/f_printer.c
+++ b/drivers/usb/gadget/function/f_printer.c
@@ -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;
}
--
2.17.1
Powered by blists - more mailing lists