]> 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)
committerJiri Slaby <jslaby@suse.cz>
Mon, 26 Jan 2015 13:38:58 +0000 (14:38 +0100)
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: Jiri Slaby <jslaby@suse.cz>
drivers/usb/class/cdc-acm.c

index f578a5aa02c0b70f7f4063a786a1ec6464d2ef18..2574b24d70c0d9421f01b3b7c24cbf7dd9786359 100644 (file)
@@ -1358,6 +1358,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: