summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/cx23885
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@kernellabs.com>2009-07-19 16:55:35 -0400
committerMichael Krufky <mkrufky@kernellabs.com>2009-07-19 16:55:35 -0400
commitac5128d842099f6536d4acef3243b0881043e519 (patch)
tree74e2bf22b24d1c9aaadc7c66865bde442629c4ea /linux/drivers/media/video/cx23885
parent337e432b2e75655ab7d267af800bd4853f8cf3c9 (diff)
downloadmediapointer-dvb-s2-ac5128d842099f6536d4acef3243b0881043e519.tar.gz
mediapointer-dvb-s2-ac5128d842099f6536d4acef3243b0881043e519.tar.bz2
cx23885: check pointers before dereferencing in dprintk macro
From: Michael Krufky <mkrufky@kernellabs.com> 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. Priority: high Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Diffstat (limited to 'linux/drivers/media/video/cx23885')
-rw-r--r--linux/drivers/media/video/cx23885/cx23885-417.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/linux/drivers/media/video/cx23885/cx23885-417.c b/linux/drivers/media/video/cx23885/cx23885-417.c
index 9c5233906..02909d7a9 100644
--- a/linux/drivers/media/video/cx23885/cx23885-417.c
+++ b/linux/drivers/media/video/cx23885/cx23885-417.c
@@ -57,7 +57,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[] = {