diff options
Diffstat (limited to 'drivers/media/video/gspca/gspca.c')
-rw-r--r-- | drivers/media/video/gspca/gspca.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c index 78abc1c1f9d5..a50bf65de06e 100644 --- a/drivers/media/video/gspca/gspca.c +++ b/drivers/media/video/gspca/gspca.c | |||
@@ -652,7 +652,7 @@ static struct usb_host_endpoint *get_ep(struct gspca_dev *gspca_dev) | |||
652 | : USB_ENDPOINT_XFER_ISOC; | 652 | : USB_ENDPOINT_XFER_ISOC; |
653 | i = gspca_dev->alt; /* previous alt setting */ | 653 | i = gspca_dev->alt; /* previous alt setting */ |
654 | if (gspca_dev->cam.reverse_alts) { | 654 | if (gspca_dev->cam.reverse_alts) { |
655 | if (gspca_dev->audio) | 655 | if (gspca_dev->audio && i < gspca_dev->nbalt - 2) |
656 | i++; | 656 | i++; |
657 | while (++i < gspca_dev->nbalt) { | 657 | while (++i < gspca_dev->nbalt) { |
658 | ep = alt_xfer(&intf->altsetting[i], xfer); | 658 | ep = alt_xfer(&intf->altsetting[i], xfer); |
@@ -660,7 +660,7 @@ static struct usb_host_endpoint *get_ep(struct gspca_dev *gspca_dev) | |||
660 | break; | 660 | break; |
661 | } | 661 | } |
662 | } else { | 662 | } else { |
663 | if (gspca_dev->audio) | 663 | if (gspca_dev->audio && i > 1) |
664 | i--; | 664 | i--; |
665 | while (--i >= 0) { | 665 | while (--i >= 0) { |
666 | ep = alt_xfer(&intf->altsetting[i], xfer); | 666 | ep = alt_xfer(&intf->altsetting[i], xfer); |