V4L/DVB: media: ir-keytable: null dereference in debug code
authorDan Carpenter <error27@gmail.com>
Fri, 6 Aug 2010 06:31:00 +0000 (03:31 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 9 Aug 2010 02:43:06 +0000 (23:43 -0300)
"ir_dev->props" can be NULL.  We only use raw mode if "ir_dev->props" is
non-NULL and "ir_dev->props->driver_type == RC_DRIVER_IR_RAW".

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/IR/ir-keytable.c

index 7032ea047f8a7b80c9901dcf24fc98c05343bb36..7e82a9df726b51ab6d90f00fc1b1fa22998c8862 100644 (file)
@@ -507,7 +507,8 @@ int __ir_input_register(struct input_dev *input_dev,
 
        IR_dprintk(1, "Registered input device on %s for %s remote%s.\n",
                   driver_name, rc_tab->name,
-                  ir_dev->props->driver_type == RC_DRIVER_IR_RAW ? " in raw mode" : "");
+                  (ir_dev->props && ir_dev->props->driver_type == RC_DRIVER_IR_RAW) ?
+                       " in raw mode" : "");
 
        return 0;