USB: fix qtd->qh poison overwritten.
authorwlf <wulf@rock-chips.com>
Fri, 14 Mar 2014 09:42:25 +0000 (17:42 +0800)
committerwlf <wulf@rock-chips.com>
Fri, 14 Mar 2014 09:42:25 +0000 (17:42 +0800)
drivers/usb/dwc_otg_310/dwc_otg_hcd.c
drivers/usb/dwc_otg_310/dwc_otg_hcd_queue.c

index e51753af6d4a8595625c8cb85749f608c40de994..9fa1312c63d93bbc15ac86bf1c12f5bad6785e58 100755 (executable)
@@ -507,8 +507,6 @@ int dwc_otg_hcd_urb_enqueue(dwc_otg_hcd_t * hcd,
                DWC_ERROR("DWC OTG HCD URB Enqueue failed adding QTD. "
                          "Error status %d\n", retval);
                dwc_otg_hcd_qtd_free(qtd);
-       } else {
-               qtd->qh = *ep_handle;
        }
        intr_mask.d32 = DWC_READ_REG32(&hcd->core_if->core_global_regs->gintmsk);
        if (!intr_mask.b.sofintr && retval == 0) {
index b2a729ee8c93349d8181a244dbd0a215d96e4a79..83b4c34a4f125798426709ac69485d41e89d7d30 100755 (executable)
@@ -711,6 +711,7 @@ int dwc_otg_hcd_qtd_add(dwc_otg_qtd_t * qtd,
                        goto done;
                }
        }
+       qtd->qh = *qh;
        DWC_SPINLOCK_IRQSAVE(hcd->lock, &flags);
        retval = dwc_otg_hcd_qh_add(hcd, *qh);
        if (retval == 0) {