linux/drivers/usb/gadget/legacy
Zhang Qilong 87bed3d7d2 usb: gadget: Fix memleak in gadgetfs_fill_super
usb_get_gadget_udc_name will alloc memory for CHIP
in "Enomem" branch. we should free it before error
returns to prevent memleak.

Fixes: 175f712119 ("usb: gadget: provide interface for legacy gadgets to get UDC name")
Reported-by: Hulk Robot <hulkci@huawei.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Link: https://lore.kernel.org/r/20201117021629.1470544-3-zhangqilong3@huawei.com
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-20 16:32:46 +01:00
..
Kconfig usb: get rid of 'choice' for legacy gadget drivers 2020-03-16 08:36:35 +01:00
Makefile usb: gadget: add raw-gadget interface 2020-03-15 11:34:48 +02:00
acm_ms.c usb: gadget: Remove set but not used variable 'opts' in acm_ms_do_config 2019-10-22 10:39:01 +03:00
audio.c usb: gadget: audio: Fix a missing error return value in audio_bind() 2020-05-09 11:05:02 +03:00
cdc2.c usb: gadget: legacy: fix error return code in cdc_bind() 2020-05-09 11:05:08 +03:00
dbgp.c USB: add SPDX identifiers to all remaining files in drivers/usb/ 2017-11-04 11:48:02 +01:00
ether.c USB: gadget: legacy: Remove redundant license text 2017-11-07 15:45:02 +01:00
g_ffs.c usb: gadget: legacy: set max_speed to super-speed 2020-01-15 10:39:21 +01:00
gmidi.c usb: gadget: legacy: gmidi: remove useless cast for driver.name 2020-02-19 11:10:24 +01:00
hid.c USB: gadget: legacy: Remove redundant license text 2017-11-07 15:45:02 +01:00
inode.c usb: gadget: Fix memleak in gadgetfs_fill_super 2020-11-20 16:32:46 +01:00
mass_storage.c usb: gadget: mass_storage: use module_usb_composite_driver to simplify the code 2020-05-25 11:09:40 +03:00
multi.c usb: gadget: legacy: set max_speed to super-speed 2020-01-15 10:39:21 +01:00
ncm.c usb: gadget: legacy: fix error return code in gncm_bind() 2020-05-09 11:05:08 +03:00
nokia.c usb: gadget: legacy: nokia: Remove unused static variable 'product_nokia' 2020-07-09 17:19:56 +02:00
printer.c usb: gadget: legacy: printer: Remove unused variable 'driver_desc' 2020-07-09 17:19:56 +02:00
raw_gadget.c usb: raw-gadget: fix memory leak in gadget_setup 2020-10-27 11:34:09 +02:00
serial.c usb: gadget: legacy/serial: allow dynamic removal 2019-10-22 10:27:15 +03:00
tcm_usb_gadget.c usb: gadget: tcm: fix spelling mistake: "Manufactor" -> "Manufacturer" 2018-07-26 13:35:29 +03:00
webcam.c usb: gadget: uvc: Move trace parameter to function module 2018-07-26 13:33:48 +03:00
zero.c USB: Fix up terminology 2020-07-01 14:04:04 +02:00