summaryrefslogtreecommitdiffstats
path: root/drivers/usb/class
diff options
context:
space:
mode:
authorOliver Neukum <oneukum@suse.de>2014-11-20 14:54:35 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-11-25 02:21:41 +0100
commitd908f8478a8d18e66c80a12adb27764920c1f1ca (patch)
tree605e2a4a002df343747c1660c91370188e3530bc /drivers/usb/class
parentMerge 3.18-rc4 into usb-next. (diff)
downloadlinux-d908f8478a8d18e66c80a12adb27764920c1f1ca.tar.xz
linux-d908f8478a8d18e66c80a12adb27764920c1f1ca.zip
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 c74fd3a3f657..6c6a5c4cc68c 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: