USB: usb_wwan: fix potential NULL-deref at resume
authorJohan Hovold <jhovold@gmail.com>
Mon, 26 May 2014 17:23:17 +0000 (19:23 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Jul 2014 03:11:57 +0000 (20:11 -0700)
commitdd38b5062df92e69afa4437d952c7194c6bfd6f5
treec458a9e80facf0351f4946921238a181f0beb0d0
parent582e7e5f9cc0d35e56bfb5e79f242d9e5dd317ba
USB: usb_wwan: fix potential NULL-deref at resume

commit 9096f1fbba916c2e052651e9de82fcfb98d4bea7 upstream.

The interrupt urb was submitted unconditionally at resume, something
which could lead to a NULL-pointer dereference in the urb completion
handler as resume may be called after the port and port data is gone.

Fix this by making sure the interrupt urb is only submitted and active
when the port is open.

Fixes: 383cedc3bb43 ("USB: serial: full autosuspend support for the
option driver")

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/serial/usb_wwan.c