Commit ca4e771f authored by Michael Krufky's avatar Michael Krufky Committed by Mauro Carvalho Chehab

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: default avatarMichael Krufky <mkrufky@kernellabs.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 12a34cc8
...@@ -58,7 +58,8 @@ MODULE_PARM_DESC(v4l_debug, "enable V4L debug messages"); ...@@ -58,7 +58,8 @@ MODULE_PARM_DESC(v4l_debug, "enable V4L debug messages");
#define dprintk(level, fmt, arg...)\ #define dprintk(level, fmt, arg...)\
do { if (v4l_debug >= level) \ 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) } while (0)
static struct cx23885_tvnorm cx23885_tvnorms[] = { static struct cx23885_tvnorm cx23885_tvnorms[] = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment