aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/usb/wusbcore/devconnect.c2
-rw-r--r--drivers/usb/wusbcore/wusbhc.c6
2 files changed, 6 insertions, 2 deletions
diff --git a/drivers/usb/wusbcore/devconnect.c b/drivers/usb/wusbcore/devconnect.c
index 63f200e4efb1..4ac4300a3f9a 100644
--- a/drivers/usb/wusbcore/devconnect.c
+++ b/drivers/usb/wusbcore/devconnect.c
@@ -267,6 +267,8 @@ static void wusbhc_devconnect_acked_work(struct work_struct *work)
267 mutex_lock(&wusbhc->mutex); 267 mutex_lock(&wusbhc->mutex);
268 wusbhc_devconnect_acked(wusbhc, wusb_dev); 268 wusbhc_devconnect_acked(wusbhc, wusb_dev);
269 mutex_unlock(&wusbhc->mutex); 269 mutex_unlock(&wusbhc->mutex);
270
271 wusb_dev_put(wusb_dev);
270} 272}
271 273
272/* 274/*
diff --git a/drivers/usb/wusbcore/wusbhc.c b/drivers/usb/wusbcore/wusbhc.c
index 07c63a31c799..3638cc68529f 100644
--- a/drivers/usb/wusbcore/wusbhc.c
+++ b/drivers/usb/wusbcore/wusbhc.c
@@ -339,13 +339,15 @@ void wusbhc_giveback_urb(struct wusbhc *wusbhc, struct urb *urb, int status)
339{ 339{
340 struct wusb_dev *wusb_dev = __wusb_dev_get_by_usb_dev(wusbhc, urb->dev); 340 struct wusb_dev *wusb_dev = __wusb_dev_get_by_usb_dev(wusbhc, urb->dev);
341 341
342 if (status == 0) { 342 if (status == 0 && wusb_dev) {
343 wusb_dev->entry_ts = jiffies; 343 wusb_dev->entry_ts = jiffies;
344 344
345 /* wusbhc_devconnect_acked() can't be called from from 345 /* wusbhc_devconnect_acked() can't be called from
346 atomic context so defer it to a work queue. */ 346 atomic context so defer it to a work queue. */
347 if (!list_empty(&wusb_dev->cack_node)) 347 if (!list_empty(&wusb_dev->cack_node))
348 queue_work(wusbd, &wusb_dev->devconnect_acked_work); 348 queue_work(wusbd, &wusb_dev->devconnect_acked_work);
349 else
350 wusb_dev_put(wusb_dev);
349 } 351 }
350 352
351 usb_hcd_giveback_urb(&wusbhc->usb_hcd, urb, status); 353 usb_hcd_giveback_urb(&wusbhc->usb_hcd, urb, status);