aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@kernellabs.com>2009-07-19 17:55:35 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-07-24 14:03:32 -0300
commitca4e771f7b878b7bab02dedb539f7742f9b4f50e (patch)
tree68485b0aa1a17373e71572f7f00c20527c9a39ba
parent12a34cc8a9a49219ab643c8ec329078eec272b47 (diff)
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>
-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 2ea7181ae8f..e0cf21e0b1b 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[] = {