USB: cdc-wdm: remove from device list on disconnect
authorBjørn Mork <bjorn@mork.no>
Wed, 9 May 2012 11:53:23 +0000 (13:53 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Jun 2012 07:18:19 +0000 (15:18 +0800)
commit9ed2cb7819e7df0e0fe0cce574c64e57b4806fe1
tree16a97e969802c5e89badb7d533ee85c2b8401190
parent577bd3ef6eed18ea3c866b2f25b14aa5e139b41f
USB: cdc-wdm: remove from device list on disconnect

commit 6286d85e8efdb59252d1ceb99a56fa6b0b11526c upstream.

Prevents dereferencing an invalid struct usb_interface
pointer.

Always delete entry from device list whether or not the
rest of the device state cleanup is postponed. The device
list uses desc->intf as key, and wdm_open will dereference
this key while searching for a matching device.  A device
should not appear in the list unless probe() has succeeded
and disconnect() has not finished.

Cc: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/class/cdc-wdm.c