Skip to contentSkip to conversation

media: ir-keytable: null dereference in debug code

PATCH New Dan Carpenter 1 participant 1 message Aug 6, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: ir-keytable: null dereference in debug code

"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".

drivers/media/IR/ir-keytable.c +2 -1
index 15a0f19..cf97427 100644
@@ -499,7 +499,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;