diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-04-14 14:17:35 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-04-27 14:45:35 -0400 |
commit | f8a389db502f7b287903b209f925df5570ff5478 (patch) | |
tree | 891329c6810b8f75790545f99d1ae6fca88ae703 /drivers/media | |
parent | c682b3a7fb8ec69ac73511bbb6a378e40aa35f35 (diff) |
V4L/DVB (5518): Fix a bug on device detection
Thanks to: Thierry MERLE <thierry.merle@free.fr> for pointing this
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/usbvision/usbvision-cards.c | 1 | ||||
-rw-r--r-- | drivers/media/video/usbvision/usbvision-cards.h | 2 | ||||
-rw-r--r-- | drivers/media/video/usbvision/usbvision-video.c | 4 |
3 files changed, 7 insertions, 0 deletions
diff --git a/drivers/media/video/usbvision/usbvision-cards.c b/drivers/media/video/usbvision/usbvision-cards.c index c632f125252c..edee094cf15d 100644 --- a/drivers/media/video/usbvision/usbvision-cards.c +++ b/drivers/media/video/usbvision/usbvision-cards.c | |||
@@ -1027,6 +1027,7 @@ struct usbvision_device_data_st usbvision_device_data[] = { | |||
1027 | .ModelString = "Hauppauge WinTv-USB", | 1027 | .ModelString = "Hauppauge WinTv-USB", |
1028 | }, | 1028 | }, |
1029 | }; | 1029 | }; |
1030 | const int usbvision_device_data_size=ARRAY_SIZE(usbvision_device_data); | ||
1030 | 1031 | ||
1031 | /* Supported Devices */ | 1032 | /* Supported Devices */ |
1032 | 1033 | ||
diff --git a/drivers/media/video/usbvision/usbvision-cards.h b/drivers/media/video/usbvision/usbvision-cards.h index 37d619b1e038..766accc927ef 100644 --- a/drivers/media/video/usbvision/usbvision-cards.h +++ b/drivers/media/video/usbvision/usbvision-cards.h | |||
@@ -63,3 +63,5 @@ | |||
63 | #define PINNA_LINX_VD_IN_CAB_PAL 62 | 63 | #define PINNA_LINX_VD_IN_CAB_PAL 62 |
64 | #define PINNA_PCTV_BUNGEE_PAL_FM 63 | 64 | #define PINNA_PCTV_BUNGEE_PAL_FM 63 |
65 | #define HPG_WINTV 64 | 65 | #define HPG_WINTV 64 |
66 | |||
67 | extern const int usbvision_device_data_size; | ||
diff --git a/drivers/media/video/usbvision/usbvision-video.c b/drivers/media/video/usbvision/usbvision-video.c index aa6509391bf9..df030bf84c00 100644 --- a/drivers/media/video/usbvision/usbvision-video.c +++ b/drivers/media/video/usbvision/usbvision-video.c | |||
@@ -1792,6 +1792,10 @@ static int __devinit usbvision_probe(struct usb_interface *intf, | |||
1792 | dev->descriptor.idProduct, ifnum); | 1792 | dev->descriptor.idProduct, ifnum); |
1793 | 1793 | ||
1794 | model = devid->driver_info; | 1794 | model = devid->driver_info; |
1795 | if ( (model<0) || (model>=usbvision_device_data_size) ) { | ||
1796 | printk(KERN_INFO "model out of bounds %d\n",model); | ||
1797 | return -ENODEV; | ||
1798 | } | ||
1795 | printk(KERN_INFO "%s: %s found\n", __FUNCTION__, | 1799 | printk(KERN_INFO "%s: %s found\n", __FUNCTION__, |
1796 | usbvision_device_data[model].ModelString); | 1800 | usbvision_device_data[model].ModelString); |
1797 | 1801 | ||