Commit affd0637 authored by Oliver Neukum's avatar Oliver Neukum Committed by Zefan Li

cdc-acm: memory leak in error case

commit d908f847 upstream.

If probe() fails not only the attributes need to be removed
but also the memory freed.
Reported-by: default avatarAhmed Tamrawi <ahmedtamrawi@gmail.com>
Signed-off-by: default avatarOliver Neukum <oneukum@suse.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
parent 58bd20d3
......@@ -1429,6 +1429,7 @@ static void acm_disconnect(struct usb_interface *intf)
&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);
usb_set_intfdata(acm->control, NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment