diff options
author | Jean-Francois Moine <moinejf@free.fr> | 2009-04-21 18:57:31 +0200 |
---|---|---|
committer | Jean-Francois Moine <moinejf@free.fr> | 2009-04-21 18:57:31 +0200 |
commit | c1c75c6d10a30d067a92060e5061488642663341 (patch) | |
tree | 9578f6f9017b0e7db9ae4f1284847b0363562e0b /linux/drivers/media/video/gspca/gspca.c | |
parent | 175b0d841f2019dc6f8383d83db6664adff68fa4 (diff) | |
download | mediapointer-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.c | 3 |
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; |