Be sure to rollback all init if input register fails.

Cc: Maxim Levitsky <maximlevit...@gmail.com>
Cc: Jarod Wilson <ja...@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mche...@redhat.com>

diff --git a/drivers/media/IR/ir-keytable.c b/drivers/media/IR/ir-keytable.c
index a616bd0..5f24cd6 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,
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to