From 991369e33f0182903d2c64e4b1c6c74ed6f83089 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 14 Oct 2010 17:49:33 -0300 Subject: [PATCH] [media] ir: properly handle an error at input_register Be sure to rollback all init if input register fails. Cc: Maxim Levitsky Acked-by: Jarod Wilson Signed-off-by: Mauro Carvalho Chehab --- drivers/media/IR/ir-keytable.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/media/IR/ir-keytable.c b/drivers/media/IR/ir-keytable.c index a616bd052336..5f24cd6ed990 100644 --- a/drivers/media/IR/ir-keytable.c +++ b/drivers/media/IR/ir-keytable.c @@ -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, -- 2.20.1