aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/host/xhci-ring.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-11-18 07:37:51 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2009-11-18 07:37:51 -0800
commit2d5bc23b32e0ec6fe9c1cdd9f371063881dc1ffc (patch)
tree3203cf45058a8ce7ebc3c712fd872e0c85fd5ccc /drivers/usb/host/xhci-ring.c
parent78db1caa8ae4e549ffc0bbf0f9b52c113e9a4da0 (diff)
parentff854ce0b17161a86b5ae444c6cb0aa221720fab (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: USB: option.c: add support for D-Link DWM-162-U5 USB: usbmon: fix bug in mon_buff_area_shrink USB: xhci: Fix scratchpad deallocation. USB: xhci: Fix TRB physical to virtual address translation. USB: xhci: Fix bug memory free after failed initialization. USB: cdc_acm: Fix memory leak after hangup USB: cdc_acm: Fix race condition when opening tty USB: ohci: quirk AMD prefetch for USB 1.1 ISO transfer
Diffstat (limited to 'drivers/usb/host/xhci-ring.c')
-rw-r--r--drivers/usb/host/xhci-ring.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 173c39c7648..821b7b4709d 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -864,9 +864,11 @@ static struct xhci_segment *trb_in_td(
cur_seg = start_seg;
do {
+ if (start_dma == 0)
+ return 0;
/* We may get an event for a Link TRB in the middle of a TD */
end_seg_dma = xhci_trb_virt_to_dma(cur_seg,
- &start_seg->trbs[TRBS_PER_SEGMENT - 1]);
+ &cur_seg->trbs[TRBS_PER_SEGMENT - 1]);
/* If the end TRB isn't in this segment, this is set to 0 */
end_trb_dma = xhci_trb_virt_to_dma(cur_seg, end_trb);
@@ -893,8 +895,9 @@ static struct xhci_segment *trb_in_td(
}
cur_seg = cur_seg->next;
start_dma = xhci_trb_virt_to_dma(cur_seg, &cur_seg->trbs[0]);
- } while (1);
+ } while (cur_seg != start_seg);
+ return 0;
}
/*