diff options
author | Oliver Neukum <oneukum@suse.de> | 2014-11-20 08:54:35 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-11-24 20:21:41 -0500 |
commit | d908f8478a8d18e66c80a12adb27764920c1f1ca (patch) | |
tree | 605e2a4a002df343747c1660c91370188e3530bc | |
parent | 69b7290e51e558e1e9c1c9ee4d5d31a3809f0f03 (diff) |
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>
-rw-r--r-- | drivers/usb/class/cdc-acm.c | 1 |
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: | |||
1473 | &dev_attr_wCountryCodes); | 1473 | &dev_attr_wCountryCodes); |
1474 | device_remove_file(&acm->control->dev, | 1474 | device_remove_file(&acm->control->dev, |
1475 | &dev_attr_iCountryCodeRelDate); | 1475 | &dev_attr_iCountryCodeRelDate); |
1476 | kfree(acm->country_codes); | ||
1476 | } | 1477 | } |
1477 | device_remove_file(&acm->control->dev, &dev_attr_bmCapabilities); | 1478 | device_remove_file(&acm->control->dev, &dev_attr_bmCapabilities); |
1478 | alloc_fail7: | 1479 | alloc_fail7: |