projects
/
GitHub
/
LineageOS
/
G12
/
android_kernel_amlogic_linux-4.9.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
69b7290
)
cdc-acm: memory leak in error case
author
Oliver Neukum
<oneukum@suse.de>
Thu, 20 Nov 2014 13:54:35 +0000
(14:54 +0100)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Tue, 25 Nov 2014 01:21:41 +0000
(17:21 -0800)
If probe() fails not only the attributes need to be removed
but also the memory freed.
Reported-by: Ahmed Tamrawi <ahmedtamrawi@gmail.com>
Signed-off-by: Oliver Neukum <oneukum@suse.de>
CC: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/class/cdc-acm.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/usb/class/cdc-acm.c
b/drivers/usb/class/cdc-acm.c
index c74fd3a3f6577bb576193aedebdd398a021ba320..6c6a5c4cc68cab2acbf261f6dbe9823b3b7e8729 100644
(file)
--- a/
drivers/usb/class/cdc-acm.c
+++ b/
drivers/usb/class/cdc-acm.c
@@
-1473,6
+1473,7
@@
alloc_fail8:
&dev_attr_wCountryCodes);
device_remove_file(&acm->control->dev,
&dev_attr_iCountryCodeRelDate);
+ kfree(acm->country_codes);
}
device_remove_file(&acm->control->dev, &dev_attr_bmCapabilities);
alloc_fail7: