From: Zqiang qiang.zhang@windriver.com
commit 2cc332e4ee4febcbb685e2962ad323fe4b3b750a upstream.
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 peter.chen@nxp.com Cc: stable@vger.kernel.org Signed-off-by: Zqiang qiang.zhang@windriver.com Link: https://lore.kernel.org/r/20201210020148.6691-1-qiang.zhang@windriver.com Signed-off-by: Greg Kroah-Hartman gregkh@linuxfoundation.org --- 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 8ed1295d7e35..0f47cd398d60 100644 --- a/drivers/usb/gadget/function/f_printer.c +++ b/drivers/usb/gadget/function/f_printer.c @@ -1126,6 +1126,7 @@ static int printer_func_bind(struct usb_configuration *c, printer_req_free(dev->in_ep, req); }
+ usb_free_all_descriptors(f); return ret;
}