summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/gspca/gspca.c
diff options
context:
space:
mode:
authorJean-Francois Moine <moinejf@free.fr>2009-04-21 18:57:31 +0200
committerJean-Francois Moine <moinejf@free.fr>2009-04-21 18:57:31 +0200
commitc1c75c6d10a30d067a92060e5061488642663341 (patch)
tree9578f6f9017b0e7db9ae4f1284847b0363562e0b /linux/drivers/media/video/gspca/gspca.c
parent175b0d841f2019dc6f8383d83db6664adff68fa4 (diff)
downloadmediapointer-dvb-s2-c1c75c6d10a30d067a92060e5061488642663341.tar.gz
mediapointer-dvb-s2-c1c75c6d10a30d067a92060e5061488642663341.tar.bz2
gspca - main: Fix a crash when no bandwidth available.
From: Jean-Francois Moine <moinejf@free.fr> When the bandwidth is not wide enough, the transfer endpoint may be set to the one of the alternate setting 0. This one may be null and this causes a divide by 0 oops. Reported-by: Hans de Goede <hdegoede@redhat.com> Priority: normal Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Diffstat (limited to 'linux/drivers/media/video/gspca/gspca.c')
-rw-r--r--linux/drivers/media/video/gspca/gspca.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/linux/drivers/media/video/gspca/gspca.c b/linux/drivers/media/video/gspca/gspca.c
index 10ee2c66f..cbdfd7552 100644
--- a/linux/drivers/media/video/gspca/gspca.c
+++ b/linux/drivers/media/video/gspca/gspca.c
@@ -461,7 +461,8 @@ static struct usb_host_endpoint *alt_xfer(struct usb_host_interface *alt,
for (i = 0; i < alt->desc.bNumEndpoints; i++) {
ep = &alt->endpoint[i];
attr = ep->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK;
- if (attr == xfer)
+ if (attr == xfer
+ && ep->desc.wMaxPacketSize != 0)
return ep;
}
return NULL;