projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5bbc852
)
usb: gadget: configs: plug memory leak
author
John Keeping
<john@metanate.com>
Tue, 28 Feb 2017 10:55:30 +0000
(10:55 +0000)
committer
Felipe Balbi
<felipe.balbi@linux.intel.com>
Mon, 6 Mar 2017 14:45:57 +0000
(16:45 +0200)
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>
drivers/usb/gadget/configfs.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/usb/gadget/configfs.c
b/drivers/usb/gadget/configfs.c
index 78c44979dde382ca8c58e9f9f84024180ce9663d..cbff3b02840df901ca0ca03c646b14f5f6085719 100644
(file)
--- a/
drivers/usb/gadget/configfs.c
+++ b/
drivers/usb/gadget/configfs.c
@@
-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;