]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
[PATCH] V4L: cx88: Avoid a NULL pointer dereference during mpeg_open()
authorSteven Toth <stoth@hauppauge.com>
Sat, 15 Sep 2007 16:28:26 +0000 (12:28 -0400)
committerWilly Tarreau <w@1wt.eu>
Wed, 17 Oct 2007 19:30:32 +0000 (21:30 +0200)
(cherry picked from commit 48200baeab95fd39a7f4c4f3536c7142a64ac335)

[PATCH] V4L: cx88: Avoid a NULL pointer dereference during mpeg_open()

Bug: With a hardware encoder board installed as cx88[1] and a
non-encoder boards installed as cx88[0], an OOPS is generated
during cx8802_get_device() called from mpeg_open().

Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/media/video/cx88/cx88-mpeg.c

index 1fe1a833c7c714a5672537d1ee5d90bd4dcad2f1..1093ff47345c9e5628ee4a7d995df2d42524b6d2 100644 (file)
@@ -556,7 +556,7 @@ struct cx8802_dev * cx8802_get_device(struct inode *inode)
 
        list_for_each(list,&cx8802_devlist) {
                h = list_entry(list, struct cx8802_dev, devlist);
-               if (h->mpeg_dev->minor == minor)
+               if (h->mpeg_dev && h->mpeg_dev->minor == minor)
                        return h;
        }