diff options
Diffstat (limited to 'drivers/usb/host/xhci-ring.c')
-rw-r--r-- | drivers/usb/host/xhci-ring.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 173c39c76489..821b7b4709de 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( | |||
864 | cur_seg = start_seg; | 864 | cur_seg = start_seg; |
865 | 865 | ||
866 | do { | 866 | do { |
867 | if (start_dma == 0) | ||
868 | return 0; | ||
867 | /* We may get an event for a Link TRB in the middle of a TD */ | 869 | /* We may get an event for a Link TRB in the middle of a TD */ |
868 | end_seg_dma = xhci_trb_virt_to_dma(cur_seg, | 870 | end_seg_dma = xhci_trb_virt_to_dma(cur_seg, |
869 | &start_seg->trbs[TRBS_PER_SEGMENT - 1]); | 871 | &cur_seg->trbs[TRBS_PER_SEGMENT - 1]); |
870 | /* If the end TRB isn't in this segment, this is set to 0 */ | 872 | /* If the end TRB isn't in this segment, this is set to 0 */ |
871 | end_trb_dma = xhci_trb_virt_to_dma(cur_seg, end_trb); | 873 | end_trb_dma = xhci_trb_virt_to_dma(cur_seg, end_trb); |
872 | 874 | ||
@@ -893,8 +895,9 @@ static struct xhci_segment *trb_in_td( | |||
893 | } | 895 | } |
894 | cur_seg = cur_seg->next; | 896 | cur_seg = cur_seg->next; |
895 | start_dma = xhci_trb_virt_to_dma(cur_seg, &cur_seg->trbs[0]); | 897 | start_dma = xhci_trb_virt_to_dma(cur_seg, &cur_seg->trbs[0]); |
896 | } while (1); | 898 | } while (cur_seg != start_seg); |
897 | 899 | ||
900 | return 0; | ||
898 | } | 901 | } |
899 | 902 | ||
900 | /* | 903 | /* |