summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx23885/cx23885-417.c
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@kernellabs.com>2009-07-19 22:55:35 +0200
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-07-24 19:03:32 +0200
commitca4e771f7b878b7bab02dedb539f7742f9b4f50e (patch)
tree68485b0aa1a17373e71572f7f00c20527c9a39ba /drivers/media/video/cx23885/cx23885-417.c
parentV4L/DVB (12302): cx23885-417: fix broken IOCTL handling (diff)
downloadlinux-ca4e771f7b878b7bab02dedb539f7742f9b4f50e.tar.xz
linux-ca4e771f7b878b7bab02dedb539f7742f9b4f50e.zip
V4L/DVB (12303): cx23885: check pointers before dereferencing in dprintk macro
When enabling debug with v4l_debug set to 2 or greater, the driver OOPS's on startup. Checks dev pointer before dereferencing, in order to prevent this OOPS. Signed-off-by: Michael Krufky <mkrufky@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx23885/cx23885-417.c')
-rw-r--r--drivers/media/video/cx23885/cx23885-417.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/media/video/cx23885/cx23885-417.c b/drivers/media/video/cx23885/cx23885-417.c
index 2ea7181ae8fb..e0cf21e0b1bf 100644
--- a/drivers/media/video/cx23885/cx23885-417.c
+++ b/drivers/media/video/cx23885/cx23885-417.c
@@ -58,7 +58,8 @@ MODULE_PARM_DESC(v4l_debug, "enable V4L debug messages");
#define dprintk(level, fmt, arg...)\
do { if (v4l_debug >= level) \
- printk(KERN_DEBUG "%s: " fmt, dev->name , ## arg);\
+ printk(KERN_DEBUG "%s: " fmt, \
+ (dev) ? dev->name : "cx23885[?]", ## arg); \
} while (0)
static struct cx23885_tvnorm cx23885_tvnorms[] = {