]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
cdc-acm: memory leak in error case
authorOliver Neukum <oneukum@suse.de>
Thu, 20 Nov 2014 13:54:35 +0000 (14:54 +0100)
committerLuis Henriques <luis.henriques@canonical.com>
Mon, 12 Jan 2015 15:43:58 +0000 (15:43 +0000)
commit d908f8478a8d18e66c80a12adb27764920c1f1ca upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
drivers/usb/class/cdc-acm.c

index 7daaef192c284153eb5ffb38e69f2462abb2bb5a..48e7a7e6093731cdcefd63b48cb6789de98788e8 100644 (file)
@@ -1470,6 +1470,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: