Commit 2cc332e4 authored by Zqiang's avatar Zqiang Committed by Greg Kroah-Hartman

usb: gadget: function: printer: Fix a memory leak for interface descriptor

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: default avatarPeter Chen <peter.chen@nxp.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarZqiang <qiang.zhang@windriver.com>
Link: https://lore.kernel.org/r/20201210020148.6691-1-qiang.zhang@windriver.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a5ada3df
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment