diff options
author | Julia Lawall <julia@diku.dk> | 2011-12-23 14:02:55 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2012-01-12 11:35:10 -0800 |
commit | e60f83773e5a5757b765b30776bd1e7fe1188c1b (patch) | |
tree | 75bd2b24cf214f4ace6a864ed2747602c1d6f397 /drivers/usb | |
parent | 608620c3e7c26618bbef00ce070e7d0bbfb9cc37 (diff) | |
download | kernel_samsung_smdk4412-e60f83773e5a5757b765b30776bd1e7fe1188c1b.zip kernel_samsung_smdk4412-e60f83773e5a5757b765b30776bd1e7fe1188c1b.tar.gz kernel_samsung_smdk4412-e60f83773e5a5757b765b30776bd1e7fe1188c1b.tar.bz2 |
drivers/usb/class/cdc-acm.c: clear dangling pointer
commit e7c8e8605d0bafc705ff27f9da98a1668427cc0f upstream.
On some failures, the country_code field of an acm structure is freed
without freeing the acm structure itself. Elsewhere, operations including
memcpy and kfree are performed on the country_code field. The patch sets
the country_code field to NULL when it is freed, and likewise sets the
country_code_size field to 0.
Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/class/cdc-acm.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index 8faa23c..b632d4b 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c @@ -1183,6 +1183,8 @@ made_compressed_probe: i = device_create_file(&intf->dev, &dev_attr_wCountryCodes); if (i < 0) { kfree(acm->country_codes); + acm->country_codes = NULL; + acm->country_code_size = 0; goto skip_countries; } @@ -1191,6 +1193,8 @@ made_compressed_probe: if (i < 0) { device_remove_file(&intf->dev, &dev_attr_wCountryCodes); kfree(acm->country_codes); + acm->country_codes = NULL; + acm->country_code_size = 0; goto skip_countries; } } |