Skip to contentSkip to conversation

V4L/DVB: ir: properly handle an error at input_register

PATCH In review Mauro Carvalho Chehab 2 participants 2 messages Oct 14, 2010 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 V4L/DVB: ir: properly handle an error at input_register

Be sure to rollback all init if input register fails.

Cc Maxim Levitsky <[email protected]>
Cc Jarod Wilson <[email protected]>
drivers/media/IR/ir-keytable.c +2 -0
index a616bd0..5f24cd6 100644
@@ -507,6 +507,8 @@ int __ir_input_register(struct input_dev *input_dev,
 		}
 
 	rc = ir_register_input(input_dev);
+	if (rc < 0)
+		goto out_event;
 
 	IR_dprintk(1, "Registered input device on %s for %s remote%s.\n",
 		   driver_name, rc_tab->name,