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()

+19 -28
+6 -1
drivers/usb/class/cdc-acm.c
··· 297 297 if (!ACM_READY(acm)) 298 298 goto exit; 299 299 300 + usb_mark_last_busy(acm->dev); 301 + 300 302 data = (unsigned char *)(dr + 1); 301 303 switch (dr->bNotificationType) { 302 304 case USB_CDC_NOTIFY_NETWORK_CONNECTION: ··· 338 336 break; 339 337 } 340 338 exit: 341 - usb_mark_last_busy(acm->dev); 342 339 retval = usb_submit_urb(urb, GFP_ATOMIC); 343 340 if (retval) 344 341 dev_err(&urb->dev->dev, "%s - usb_submit_urb failed with " ··· 534 533 if (!ACM_READY(acm)) 535 534 return; 536 535 tty = tty_port_tty_get(&acm->port); 536 + if (!tty) 537 + return; 537 538 tty_wakeup(tty); 538 539 tty_kref_put(tty); 539 540 } ··· 649 646 usb_kill_urb(acm->ctrlurb); 650 647 for (i = 0; i < ACM_NW; i++) 651 648 usb_kill_urb(acm->wb[i].urb); 649 + tasklet_disable(&acm->urb_task); 652 650 for (i = 0; i < nr; i++) 653 651 usb_kill_urb(acm->ru[i].urb); 652 + tasklet_enable(&acm->urb_task); 654 653 acm->control->needs_remote_wakeup = 0; 655 654 usb_autopm_put_interface(acm->control); 656 655 }
+1 -1
drivers/usb/class/cdc-wdm.c
··· 281 281 desc->sbuf, 282 282 desc->validity->transfer_dma); 283 283 usb_free_coherent(interface_to_usbdev(desc->intf), 284 - desc->wMaxCommand, 284 + desc->bMaxPacketSize0, 285 285 desc->inbuf, 286 286 desc->response->transfer_dma); 287 287 kfree(desc->orq);
+1 -1
drivers/usb/core/devio.c
··· 802 802 tbuf, ctrl.wLength, tmo); 803 803 usb_lock_device(dev); 804 804 snoop_urb(dev, NULL, pipe, max(i, 0), min(i, 0), COMPLETE, 805 - tbuf, i); 805 + tbuf, max(i, 0)); 806 806 if ((i > 0) && ctrl.wLength) { 807 807 if (copy_to_user(ctrl.data, tbuf, i)) { 808 808 free_page((unsigned long)tbuf);
-12
drivers/usb/host/ehci-q.c
··· 315 315 int stopped; 316 316 unsigned count = 0; 317 317 u8 state; 318 - const __le32 halt = HALT_BIT(ehci); 319 318 struct ehci_qh_hw *hw = qh->hw; 320 319 321 320 if (unlikely (list_empty (&qh->qtd_list))) ··· 421 422 && !(qtd->hw_alt_next 422 423 & EHCI_LIST_END(ehci))) { 423 424 stopped = 1; 424 - goto halt; 425 425 } 426 426 427 427 /* stop scanning when we reach qtds the hc is using */ ··· 453 455 * We have to clear it. 454 456 */ 455 457 ehci_clear_tt_buffer(ehci, qh, urb, token); 456 - } 457 - 458 - /* force halt for unlinked or blocked qh, so we'll 459 - * patch the qh later and so that completions can't 460 - * activate it while we "know" it's stopped. 461 - */ 462 - if ((halt & hw->hw_token) == 0) { 463 - halt: 464 - hw->hw_token |= halt; 465 - wmb (); 466 458 } 467 459 } 468 460
+3 -4
drivers/usb/misc/uss720.c
··· 177 177 spin_lock_irqsave(&priv->asynclock, flags); 178 178 list_add_tail(&rq->asynclist, &priv->asynclist); 179 179 spin_unlock_irqrestore(&priv->asynclock, flags); 180 + kref_get(&rq->ref_count); 180 181 ret = usb_submit_urb(rq->urb, mem_flags); 181 - if (!ret) { 182 - kref_get(&rq->ref_count); 182 + if (!ret) 183 183 return rq; 184 - } 185 - kref_put(&rq->ref_count, destroy_async); 184 + destroy_async(&rq->ref_count); 186 185 err("submit_async_request submit_urb failed with %d", ret); 187 186 return NULL; 188 187 }
+3 -3
drivers/usb/musb/blackfin.c
··· 322 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 327 return 0; 328 328 } ··· 540 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 544 #else 545 545 #define DEV_PM_OPS NULL 546 546 #endif ··· 548 548 static struct platform_driver bfin_driver = { 549 549 .remove = __exit_p(bfin_remove), 550 550 .driver = { 551 - .name = "musb-bfin", 551 + .name = "musb-blackfin", 552 552 .pm = DEV_PM_OPS, 553 553 }, 554 554 };
+4 -4
drivers/usb/musb/musb_gadget.c
··· 1880 1880 if (retval < 0) { 1881 1881 DBG(1, "add_hcd failed, %d\n", retval); 1882 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 } 1884 + 1885 + if ((musb->xceiv->last_event == USB_EVENT_ID) 1886 + && musb->xceiv->set_vbus) 1887 + otg_set_vbus(musb->xceiv, 1); 1888 1888 1889 1889 hcd->self.uses_pio_for_control = 1; 1890 1890
+1 -2
drivers/usb/serial/usb_wwan.c
··· 698 698 /* we have to throw away the rest */ 699 699 do { 700 700 unbusy_queued_urb(urb, portdata); 701 - //extremely dirty 702 - atomic_dec(&port->serial->interface->dev.power.usage_count); 701 + usb_autopm_put_interface_no_suspend(port->serial->interface); 703 702 } while ((urb = usb_get_from_anchor(&portdata->delayed))); 704 703 break; 705 704 }