[media] ir: properly handle an error at input_register
authorMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 14 Oct 2010 20:49:33 +0000 (17:49 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 21 Oct 2010 09:54:14 +0000 (07:54 -0200)
Be sure to rollback all init if input register fails.

Cc: Maxim Levitsky <maximlevitsky@gmail.com>
Acked-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/IR/ir-keytable.c

index a616bd0523360b51858fa231b5b4709fe26ad533..5f24cd6ed990ae0017422b32e603221f343aa880 100644 (file)
@@ -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,