V4L/DVB (10218): cx23885: Fix Oops for mixed install of analog and digital only cards
authorAndy Walls <awalls@radix.net>
Sat, 10 Jan 2009 01:59:27 +0000 (22:59 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 29 Jan 2009 10:35:38 +0000 (08:35 -0200)
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>
drivers/media/video/cx23885/cx23885-417.c
drivers/media/video/cx23885/cx23885-video.c

index 8f1db57bd1dd8cefc4fcd7b55865429ec04491bd..bfe25841dbf483239777cd72dddcbafb8e087a39 100644 (file)
@@ -1586,7 +1586,8 @@ static int mpeg_open(struct file *file)
        lock_kernel();
        list_for_each(list, &cx23885_devlist) {
                h = list_entry(list, struct cx23885_dev, devlist);
-               if (h->v4l_device->minor == minor) {
+               if (h->v4l_device &&
+                   h->v4l_device->minor == minor) {
                        dev = h;
                        break;
                }
index 2d81c4d043403297b504a2b77b5a17560cde31c7..eaa11893bfe918f23e1ca7403179c7d2ec975680 100644 (file)
@@ -730,12 +730,13 @@ static int video_open(struct file *file)
        lock_kernel();
        list_for_each(list, &cx23885_devlist) {
                h = list_entry(list, struct cx23885_dev, devlist);
-               if (h->video_dev->minor == minor) {
+               if (h->video_dev &&
+                   h->video_dev->minor == minor) {
                        dev  = h;
                        type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
                }
                if (h->vbi_dev &&
-                  h->vbi_dev->minor == minor) {
+                   h->vbi_dev->minor == minor) {
                        dev  = h;
                        type = V4L2_BUF_TYPE_VBI_CAPTURE;
                }
This page took 0.049642 seconds and 5 git commands to generate.