mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 14:42:37 +02:00
usb: gadget: configs: plug memory leak
[ Upstream commit 38355b2a44 ]
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>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
24e9fc7ef0
commit
4036947a43
|
|
@ -270,6 +270,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->udc_name) {
|
||||
ret = -EBUSY;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user