From 1b5378ef402120ff13f344edaf8bca4761f82ee5 Mon Sep 17 00:00:00 2001 From: Steven Toth Date: Thu, 6 Sep 2007 21:48:35 -0400 Subject: Avoid a NULL pointer dereference during mpeg_open() From: Steven Toth 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 --- linux/drivers/media/video/cx88/cx88-mpeg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linux') diff --git a/linux/drivers/media/video/cx88/cx88-mpeg.c b/linux/drivers/media/video/cx88/cx88-mpeg.c index effac1619..f3447f1d7 100644 --- a/linux/drivers/media/video/cx88/cx88-mpeg.c +++ b/linux/drivers/media/video/cx88/cx88-mpeg.c @@ -637,7 +637,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; } -- cgit v1.2.3