Thread (150 messages) 150 messages, 4 authors, 2015-01-15
STALE4189d

[PATCH 3.18 090/150] cdc-acm: memory leak in error case

From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: 2015-01-14 08:16:37
Also in: lkml

3.18-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Oliver Neukum <redacted>

commit d908f8478a8d18e66c80a12adb27764920c1f1ca upstream.

If probe() fails not only the attributes need to be removed
but also the memory freed.

Reported-by: Ahmed Tamrawi <redacted>
Signed-off-by: Oliver Neukum <redacted>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/usb/class/cdc-acm.c |    1 +
 1 file changed, 1 insertion(+)
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -1476,6 +1476,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:

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help