USB: cdc-wdm: cannot use dev_printk when device is gone
authorBjørn Mork <bjorn@mork.no>
Wed, 9 May 2012 11:53:22 +0000 (13:53 +0200)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 30 May 2012 23:43:41 +0000 (00:43 +0100)
commit8fd4242d5ce7514591eff1b1170ab253b215a787
treeec514e1e84cf83c20467af65d54c3650ac58809b
parent0c68ab1b23871bbfa1bb7e792d476e9618a749c0
USB: cdc-wdm: cannot use dev_printk when device is gone

commit 6b0b79d38806481c1c8fffa7c5842f3c83679a42 upstream.

We cannot dereference a removed USB interface for
dev_printk. Use pr_debug instead where necessary.

Flush errors are expected if device is unplugged and are
therefore best ingored at this point.

Move the kill_urbs() call in wdm_release with dev_dbg()
for the non disconnect, as we know it has already been
called if WDM_DISCONNECTING is set.  This does not
actually fix anything, but keeps the code more consistent.

Cc: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/usb/class/cdc-wdm.c