diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-24 13:02:55 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-24 13:02:55 -0400 |
commit | b4a41ed24c858d75985c7dcba685715fdf2e6114 (patch) | |
tree | 04a28143a4b6ce37fdca3106dabfae713315184c /drivers/usb | |
parent | 76d21c563569bcea6bc67d65cc2c460cff643058 (diff) | |
parent | 7e7797e7f6f7bfab73fca02c65e40eaa5bb9000c (diff) |
Merge branch 'usb-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
* 'usb-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6:
USB: cdc-acm: fix potential null-pointer dereference on disconnect
USB: cdc-acm: fix potential null-pointer dereference
USB: cdc-acm: fix memory corruption / panic
USB: Fix 'bad dma' problem on WDM device disconnect
usb: wwan: fix compilation without CONFIG_PM_RUNTIME
USB: uss720 fixup refcount position
usb: musb: blackfin: fix typo in new bfin_musb_vbus_status func
usb: musb: blackfin: fix typo in new dev_pm_ops struct
usb: musb: blackfin: fix typo in platform driver name
usb: musb: Fix for merge issue
ehci-hcd: Bug fix: don't set a QH's Halt bit
USB: Do not pass negative length to snoop_urb()
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/class/cdc-acm.c | 7 | ||||
-rw-r--r-- | drivers/usb/class/cdc-wdm.c | 2 | ||||
-rw-r--r-- | drivers/usb/core/devio.c | 2 | ||||
-rw-r--r-- | drivers/usb/host/ehci-q.c | 12 | ||||
-rw-r--r-- | drivers/usb/misc/uss720.c | 7 | ||||
-rw-r--r-- | drivers/usb/musb/blackfin.c | 6 | ||||
-rw-r--r-- | drivers/usb/musb/musb_gadget.c | 8 | ||||
-rw-r--r-- | drivers/usb/serial/usb_wwan.c | 3 |
8 files changed, 19 insertions, 28 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index f492a7f2b6ee..e057e5381465 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c | |||
@@ -297,6 +297,8 @@ static void acm_ctrl_irq(struct urb *urb) | |||
297 | if (!ACM_READY(acm)) | 297 | if (!ACM_READY(acm)) |
298 | goto exit; | 298 | goto exit; |
299 | 299 | ||
300 | usb_mark_last_busy(acm->dev); | ||
301 | |||
300 | data = (unsigned char *)(dr + 1); | 302 | data = (unsigned char *)(dr + 1); |
301 | switch (dr->bNotificationType) { | 303 | switch (dr->bNotificationType) { |
302 | case USB_CDC_NOTIFY_NETWORK_CONNECTION: | 304 | case USB_CDC_NOTIFY_NETWORK_CONNECTION: |
@@ -336,7 +338,6 @@ static void acm_ctrl_irq(struct urb *urb) | |||
336 | break; | 338 | break; |
337 | } | 339 | } |
338 | exit: | 340 | exit: |
339 | usb_mark_last_busy(acm->dev); | ||
340 | retval = usb_submit_urb(urb, GFP_ATOMIC); | 341 | retval = usb_submit_urb(urb, GFP_ATOMIC); |
341 | if (retval) | 342 | if (retval) |
342 | dev_err(&urb->dev->dev, "%s - usb_submit_urb failed with " | 343 | dev_err(&urb->dev->dev, "%s - usb_submit_urb failed with " |
@@ -533,6 +534,8 @@ static void acm_softint(struct work_struct *work) | |||
533 | if (!ACM_READY(acm)) | 534 | if (!ACM_READY(acm)) |
534 | return; | 535 | return; |
535 | tty = tty_port_tty_get(&acm->port); | 536 | tty = tty_port_tty_get(&acm->port); |
537 | if (!tty) | ||
538 | return; | ||
536 | tty_wakeup(tty); | 539 | tty_wakeup(tty); |
537 | tty_kref_put(tty); | 540 | tty_kref_put(tty); |
538 | } | 541 | } |
@@ -646,8 +649,10 @@ static void acm_port_down(struct acm *acm) | |||
646 | usb_kill_urb(acm->ctrlurb); | 649 | usb_kill_urb(acm->ctrlurb); |
647 | for (i = 0; i < ACM_NW; i++) | 650 | for (i = 0; i < ACM_NW; i++) |
648 | usb_kill_urb(acm->wb[i].urb); | 651 | usb_kill_urb(acm->wb[i].urb); |
652 | tasklet_disable(&acm->urb_task); | ||
649 | for (i = 0; i < nr; i++) | 653 | for (i = 0; i < nr; i++) |
650 | usb_kill_urb(acm->ru[i].urb); | 654 | usb_kill_urb(acm->ru[i].urb); |
655 | tasklet_enable(&acm->urb_task); | ||
651 | acm->control->needs_remote_wakeup = 0; | 656 | acm->control->needs_remote_wakeup = 0; |
652 | usb_autopm_put_interface(acm->control); | 657 | usb_autopm_put_interface(acm->control); |
653 | } | 658 | } |
diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c index 47085e5879ab..a97c018dd419 100644 --- a/drivers/usb/class/cdc-wdm.c +++ b/drivers/usb/class/cdc-wdm.c | |||
@@ -281,7 +281,7 @@ static void cleanup(struct wdm_device *desc) | |||
281 | desc->sbuf, | 281 | desc->sbuf, |
282 | desc->validity->transfer_dma); | 282 | desc->validity->transfer_dma); |
283 | usb_free_coherent(interface_to_usbdev(desc->intf), | 283 | usb_free_coherent(interface_to_usbdev(desc->intf), |
284 | desc->wMaxCommand, | 284 | desc->bMaxPacketSize0, |
285 | desc->inbuf, | 285 | desc->inbuf, |
286 | desc->response->transfer_dma); | 286 | desc->response->transfer_dma); |
287 | kfree(desc->orq); | 287 | kfree(desc->orq); |
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index a7131ad630f9..37518dfdeb98 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c | |||
@@ -802,7 +802,7 @@ static int proc_control(struct dev_state *ps, void __user *arg) | |||
802 | tbuf, ctrl.wLength, tmo); | 802 | tbuf, ctrl.wLength, tmo); |
803 | usb_lock_device(dev); | 803 | usb_lock_device(dev); |
804 | snoop_urb(dev, NULL, pipe, max(i, 0), min(i, 0), COMPLETE, | 804 | snoop_urb(dev, NULL, pipe, max(i, 0), min(i, 0), COMPLETE, |
805 | tbuf, i); | 805 | tbuf, max(i, 0)); |
806 | if ((i > 0) && ctrl.wLength) { | 806 | if ((i > 0) && ctrl.wLength) { |
807 | if (copy_to_user(ctrl.data, tbuf, i)) { | 807 | if (copy_to_user(ctrl.data, tbuf, i)) { |
808 | free_page((unsigned long)tbuf); | 808 | free_page((unsigned long)tbuf); |
diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c index fe99895fb098..98ded66e8d3f 100644 --- a/drivers/usb/host/ehci-q.c +++ b/drivers/usb/host/ehci-q.c | |||
@@ -315,7 +315,6 @@ qh_completions (struct ehci_hcd *ehci, struct ehci_qh *qh) | |||
315 | int stopped; | 315 | int stopped; |
316 | unsigned count = 0; | 316 | unsigned count = 0; |
317 | u8 state; | 317 | u8 state; |
318 | const __le32 halt = HALT_BIT(ehci); | ||
319 | struct ehci_qh_hw *hw = qh->hw; | 318 | struct ehci_qh_hw *hw = qh->hw; |
320 | 319 | ||
321 | if (unlikely (list_empty (&qh->qtd_list))) | 320 | if (unlikely (list_empty (&qh->qtd_list))) |
@@ -422,7 +421,6 @@ qh_completions (struct ehci_hcd *ehci, struct ehci_qh *qh) | |||
422 | && !(qtd->hw_alt_next | 421 | && !(qtd->hw_alt_next |
423 | & EHCI_LIST_END(ehci))) { | 422 | & EHCI_LIST_END(ehci))) { |
424 | stopped = 1; | 423 | stopped = 1; |
425 | goto halt; | ||
426 | } | 424 | } |
427 | 425 | ||
428 | /* stop scanning when we reach qtds the hc is using */ | 426 | /* stop scanning when we reach qtds the hc is using */ |
@@ -456,16 +454,6 @@ qh_completions (struct ehci_hcd *ehci, struct ehci_qh *qh) | |||
456 | */ | 454 | */ |
457 | ehci_clear_tt_buffer(ehci, qh, urb, token); | 455 | ehci_clear_tt_buffer(ehci, qh, urb, token); |
458 | } | 456 | } |
459 | |||
460 | /* force halt for unlinked or blocked qh, so we'll | ||
461 | * patch the qh later and so that completions can't | ||
462 | * activate it while we "know" it's stopped. | ||
463 | */ | ||
464 | if ((halt & hw->hw_token) == 0) { | ||
465 | halt: | ||
466 | hw->hw_token |= halt; | ||
467 | wmb (); | ||
468 | } | ||
469 | } | 457 | } |
470 | 458 | ||
471 | /* unless we already know the urb's status, collect qtd status | 459 | /* unless we already know the urb's status, collect qtd status |
diff --git a/drivers/usb/misc/uss720.c b/drivers/usb/misc/uss720.c index f7a205738032..8b1d94a76914 100644 --- a/drivers/usb/misc/uss720.c +++ b/drivers/usb/misc/uss720.c | |||
@@ -177,12 +177,11 @@ static struct uss720_async_request *submit_async_request(struct parport_uss720_p | |||
177 | spin_lock_irqsave(&priv->asynclock, flags); | 177 | spin_lock_irqsave(&priv->asynclock, flags); |
178 | list_add_tail(&rq->asynclist, &priv->asynclist); | 178 | list_add_tail(&rq->asynclist, &priv->asynclist); |
179 | spin_unlock_irqrestore(&priv->asynclock, flags); | 179 | spin_unlock_irqrestore(&priv->asynclock, flags); |
180 | kref_get(&rq->ref_count); | ||
180 | ret = usb_submit_urb(rq->urb, mem_flags); | 181 | ret = usb_submit_urb(rq->urb, mem_flags); |
181 | if (!ret) { | 182 | if (!ret) |
182 | kref_get(&rq->ref_count); | ||
183 | return rq; | 183 | return rq; |
184 | } | 184 | destroy_async(&rq->ref_count); |
185 | kref_put(&rq->ref_count, destroy_async); | ||
186 | err("submit_async_request submit_urb failed with %d", ret); | 185 | err("submit_async_request submit_urb failed with %d", ret); |
187 | return NULL; | 186 | return NULL; |
188 | } | 187 | } |
diff --git a/drivers/usb/musb/blackfin.c b/drivers/usb/musb/blackfin.c index 9d49d1cd7ce2..52312e8af213 100644 --- a/drivers/usb/musb/blackfin.c +++ b/drivers/usb/musb/blackfin.c | |||
@@ -322,7 +322,7 @@ static void bfin_musb_try_idle(struct musb *musb, unsigned long timeout) | |||
322 | mod_timer(&musb_conn_timer, jiffies + TIMER_DELAY); | 322 | mod_timer(&musb_conn_timer, jiffies + TIMER_DELAY); |
323 | } | 323 | } |
324 | 324 | ||
325 | static int bfin_musb_get_vbus_status(struct musb *musb) | 325 | static int bfin_musb_vbus_status(struct musb *musb) |
326 | { | 326 | { |
327 | return 0; | 327 | return 0; |
328 | } | 328 | } |
@@ -540,7 +540,7 @@ static struct dev_pm_ops bfin_pm_ops = { | |||
540 | .resume = bfin_resume, | 540 | .resume = bfin_resume, |
541 | }; | 541 | }; |
542 | 542 | ||
543 | #define DEV_PM_OPS &bfin_pm_op, | 543 | #define DEV_PM_OPS &bfin_pm_ops |
544 | #else | 544 | #else |
545 | #define DEV_PM_OPS NULL | 545 | #define DEV_PM_OPS NULL |
546 | #endif | 546 | #endif |
@@ -548,7 +548,7 @@ static struct dev_pm_ops bfin_pm_ops = { | |||
548 | static struct platform_driver bfin_driver = { | 548 | static struct platform_driver bfin_driver = { |
549 | .remove = __exit_p(bfin_remove), | 549 | .remove = __exit_p(bfin_remove), |
550 | .driver = { | 550 | .driver = { |
551 | .name = "musb-bfin", | 551 | .name = "musb-blackfin", |
552 | .pm = DEV_PM_OPS, | 552 | .pm = DEV_PM_OPS, |
553 | }, | 553 | }, |
554 | }; | 554 | }; |
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index 5c7b321d3959..98519c5d8b5c 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c | |||
@@ -1880,12 +1880,12 @@ int usb_gadget_probe_driver(struct usb_gadget_driver *driver, | |||
1880 | if (retval < 0) { | 1880 | if (retval < 0) { |
1881 | DBG(1, "add_hcd failed, %d\n", retval); | 1881 | DBG(1, "add_hcd failed, %d\n", retval); |
1882 | goto err2; | 1882 | goto err2; |
1883 | |||
1884 | if ((musb->xceiv->last_event == USB_EVENT_ID) | ||
1885 | && musb->xceiv->set_vbus) | ||
1886 | otg_set_vbus(musb->xceiv, 1); | ||
1887 | } | 1883 | } |
1888 | 1884 | ||
1885 | if ((musb->xceiv->last_event == USB_EVENT_ID) | ||
1886 | && musb->xceiv->set_vbus) | ||
1887 | otg_set_vbus(musb->xceiv, 1); | ||
1888 | |||
1889 | hcd->self.uses_pio_for_control = 1; | 1889 | hcd->self.uses_pio_for_control = 1; |
1890 | 1890 | ||
1891 | if (musb->xceiv->last_event == USB_EVENT_NONE) | 1891 | if (musb->xceiv->last_event == USB_EVENT_NONE) |
diff --git a/drivers/usb/serial/usb_wwan.c b/drivers/usb/serial/usb_wwan.c index a65ddd543869..e4fad5e643d7 100644 --- a/drivers/usb/serial/usb_wwan.c +++ b/drivers/usb/serial/usb_wwan.c | |||
@@ -698,8 +698,7 @@ static void play_delayed(struct usb_serial_port *port) | |||
698 | /* we have to throw away the rest */ | 698 | /* we have to throw away the rest */ |
699 | do { | 699 | do { |
700 | unbusy_queued_urb(urb, portdata); | 700 | unbusy_queued_urb(urb, portdata); |
701 | //extremely dirty | 701 | usb_autopm_put_interface_no_suspend(port->serial->interface); |
702 | atomic_dec(&port->serial->interface->dev.power.usage_count); | ||
703 | } while ((urb = usb_get_from_anchor(&portdata->delayed))); | 702 | } while ((urb = usb_get_from_anchor(&portdata->delayed))); |
704 | break; | 703 | break; |
705 | } | 704 | } |