aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorAndy Walls <awalls@radix.net>2009-01-09 20:59:27 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-01-29 05:35:38 -0500
commitcd8f894eacf13996d920fdd2aef1afc55156b191 (patch)
treeecfc9081e69be3186ce97bc80190aae71b4e4d45 /drivers/media
parent0f3559ef17362a7dd5017521a4dd4cad31263395 (diff)
V4L/DVB (10218): cx23885: Fix Oops for mixed install of analog and digital only cards
Analog support for HVR-1250 has not been completed, but does exist for the HVR-1800. Since both cards use the same driver, it tries to create the analog dev for both devices, which is not possible. This causes a NULL error to show up in video_open and mpeg_open. -Mark Iterations through the cx23885_devlist must check for NULL pointers as some supported devices only have DVB support at the moment. Mark Jenks encoutered an Oops in a system with both an HVR-1250 and HVR-1800 installed. -Andy Reported-by: Mark Jenks <mjenks1968@gmail.com> Tested-by: Mark Jenks <mjenks1968@gmail.com> Signed-off-by: Mark Jenks <mjenks1968@gmail.com> Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/cx23885/cx23885-417.c3
-rw-r--r--drivers/media/video/cx23885/cx23885-video.c5
2 files changed, 5 insertions, 3 deletions
diff --git a/drivers/media/video/cx23885/cx23885-417.c b/drivers/media/video/cx23885/cx23885-417.c
index 8f1db57bd1dd..bfe25841dbf4 100644
--- a/drivers/media/video/cx23885/cx23885-417.c
+++ b/drivers/media/video/cx23885/cx23885-417.c
@@ -1586,7 +1586,8 @@ static int mpeg_open(struct file *file)
1586 lock_kernel(); 1586 lock_kernel();
1587 list_for_each(list, &cx23885_devlist) { 1587 list_for_each(list, &cx23885_devlist) {
1588 h = list_entry(list, struct cx23885_dev, devlist); 1588 h = list_entry(list, struct cx23885_dev, devlist);
1589 if (h->v4l_device->minor == minor) { 1589 if (h->v4l_device &&
1590 h->v4l_device->minor == minor) {
1590 dev = h; 1591 dev = h;
1591 break; 1592 break;
1592 } 1593 }
diff --git a/drivers/media/video/cx23885/cx23885-video.c b/drivers/media/video/cx23885/cx23885-video.c
index 2d81c4d04340..eaa11893bfe9 100644
--- a/drivers/media/video/cx23885/cx23885-video.c
+++ b/drivers/media/video/cx23885/cx23885-video.c
@@ -730,12 +730,13 @@ static int video_open(struct file *file)
730 lock_kernel(); 730 lock_kernel();
731 list_for_each(list, &cx23885_devlist) { 731 list_for_each(list, &cx23885_devlist) {
732 h = list_entry(list, struct cx23885_dev, devlist); 732 h = list_entry(list, struct cx23885_dev, devlist);
733 if (h->video_dev->minor == minor) { 733 if (h->video_dev &&
734 h->video_dev->minor == minor) {
734 dev = h; 735 dev = h;
735 type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 736 type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
736 } 737 }
737 if (h->vbi_dev && 738 if (h->vbi_dev &&
738 h->vbi_dev->minor == minor) { 739 h->vbi_dev->minor == minor) {
739 dev = h; 740 dev = h;
740 type = V4L2_BUF_TYPE_VBI_CAPTURE; 741 type = V4L2_BUF_TYPE_VBI_CAPTURE;
741 } 742 }