[RFC 2/2] usb: usb_wwan: port may be gone on device resume

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We cannot unconditionally access any usb-serial port specific
data from the USB driver.  The usb-serial port may already
be gone when the USB device is resumed.  This will happen
when the driver is unloaded.

Treat ports with no portdata as closed ports to avoid a NULL
pointer dereference on resume.

Signed-off-by: Bjørn Mork <bjorn@xxxxxxx>
---
 drivers/usb/serial/usb_wwan.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/serial/usb_wwan.c b/drivers/usb/serial/usb_wwan.c
index 7d08113..25d73f4 100644
--- a/drivers/usb/serial/usb_wwan.c
+++ b/drivers/usb/serial/usb_wwan.c
@@ -700,7 +700,7 @@ int usb_wwan_resume(struct usb_serial *serial)
 
 		/* skip closed ports */
 		spin_lock_irq(&intfdata->susp_lock);
-		if (!portdata->opened) {
+		if (!portdata || !portdata->opened) {
 			spin_unlock_irq(&intfdata->susp_lock);
 			continue;
 		}
-- 
1.7.2.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux