mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04: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 <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
This commit is contained in:
parent
5bbc852676
commit
38355b2a44
1 changed files with 1 additions and 0 deletions
|
|
@ -269,6 +269,7 @@ static ssize_t gadget_dev_desc_UDC_store(struct config_item *item,
|
|||
ret = unregister_gadget(gi);
|
||||
if (ret)
|
||||
goto err;
|
||||
kfree(name);
|
||||
} else {
|
||||
if (gi->composite.gadget_driver.udc_name) {
|
||||
ret = -EBUSY;
|
||||
|
|
|
|||
Loading…
Reference in a new issue