usb: gadget: function: printer: Fix a memory leak for interface descriptor
commit97d36b7be15c4368334afe93a6766b06ad53d3e6
authorZqiang <qiang.zhang@windriver.com>
Thu, 10 Dec 2020 02:01:48 +0000 (10 10:01 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Jan 2021 18:49:04 +0000 (12 19:49 +0100)
tree986017ae77051bd28b86b4300c01afabf82a1fba
parenta927ba260508cd33fccd6c74bd58f6627096c121
usb: gadget: function: printer: Fix a memory leak for interface descriptor

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