drivers/usb/class/cdc-acm.c: clear dangling pointer
commite60f83773e5a5757b765b30776bd1e7fe1188c1b
authorJulia Lawall <julia@diku.dk>
Fri, 23 Dec 2011 13:02:55 +0000 (23 14:02 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 12 Jan 2012 19:35:10 +0000 (12 11:35 -0800)
tree75bd2b24cf214f4ace6a864ed2747602c1d6f397
parent608620c3e7c26618bbef00ce070e7d0bbfb9cc37
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>
drivers/usb/class/cdc-acm.c