Explorar o código

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>
Oliver Neukum %!s(int64=10) %!d(string=hai) anos
pai
achega
d908f8478a
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      drivers/usb/class/cdc-acm.c

+ 1 - 0
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: