summaryrefslogtreecommitdiff
path: root/drivers/usb/class
diff options
context:
space:
mode:
authorOliver Neukum <oneukum@suse.de>2014-11-20 13:54:35 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-11-25 01:21:41 (GMT)
commitd908f8478a8d18e66c80a12adb27764920c1f1ca (patch)
tree605e2a4a002df343747c1660c91370188e3530bc /drivers/usb/class
parent69b7290e51e558e1e9c1c9ee4d5d31a3809f0f03 (diff)
downloadlinux-d908f8478a8d18e66c80a12adb27764920c1f1ca.tar.xz
cdc-acm: memory leak in error case
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>
Diffstat (limited to 'drivers/usb/class')
-rw-r--r--drivers/usb/class/cdc-acm.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index c74fd3a..6c6a5c4 100644
--- 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: