mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-20 19:23:57 +08:00
usb: gadget: configs: plug memory leak
When binding a gadget to a device, "name" is stored in gi->udc_name, but this does not happen when unregistering and the string is leaked. Signed-off-by: John Keeping <john@metanate.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
This commit is contained in:
parent
5bbc852676
commit
38355b2a44
@ -269,6 +269,7 @@ static ssize_t gadget_dev_desc_UDC_store(struct config_item *item,
|
|||||||
ret = unregister_gadget(gi);
|
ret = unregister_gadget(gi);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto err;
|
goto err;
|
||||||
|
kfree(name);
|
||||||
} else {
|
} else {
|
||||||
if (gi->composite.gadget_driver.udc_name) {
|
if (gi->composite.gadget_driver.udc_name) {
|
||||||
ret = -EBUSY;
|
ret = -EBUSY;
|
||||||
|
Loading…
Reference in New Issue
Block a user