]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] Re: PATCH: 2.5.8 ehci, submit errors
authorDavid Brownell <david-b@pacbell.net>
Mon, 22 Apr 2002 06:33:19 +0000 (23:33 -0700)
committerGreg Kroah-Hartman <greg@kroah.com>
Mon, 22 Apr 2002 06:33:19 +0000 (23:33 -0700)
Oh, and for non-x86 platforms with interesting pci
mapping, this tweak to one new routine would be
important in a particular error path I've yet to see ... :)

drivers/usb/host/ehci-q.c

index c1ab43b5426f61309d1859b9153a9d82215b6822..11edb93669382897657805d0c83fb5bc21d916b1 100644 (file)
@@ -426,23 +426,25 @@ static void qtd_list_free (
                list_del (&qtd->qtd_list);
                if (unmapped != 2) {
                        int     direction;
+                       size_t  size;
 
                        /* for ctrl unmap twice: SETUP and DATA;
                         * else (bulk, intr) just once: DATA
                         */
-                       if (!unmapped++ && usb_pipecontrol (urb->pipe))
+                       if (!unmapped++ && usb_pipecontrol (urb->pipe)) {
                                direction = PCI_DMA_TODEVICE;
-                       else {
+                               size = sizeof (struct usb_ctrlrequest);
+                       } else {
                                direction = usb_pipein (urb->pipe)
                                        ? PCI_DMA_FROMDEVICE
                                        : PCI_DMA_TODEVICE;
+                               size = qtd->urb->transfer_buffer_length;
                                unmapped++;
                        }
                        if (qtd->buf_dma)
                                pci_unmap_single (ehci->hcd.pdev,
                                        qtd->buf_dma,
-                                       qtd->urb->transfer_buffer_length,
-                                       direction);
+                                       size, direction);
                }
                ehci_qtd_free (ehci, qtd);
        }