Input: ims-pcu - fix error unwinding path in application mode
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Sat, 4 Jan 2014 04:54:37 +0000 (20:54 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 12 Feb 2014 23:09:40 +0000 (15:09 -0800)
We first create backlight and then input devices so we should destroy them
in opposite order when handling errors.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/misc/ims-pcu.c

index e204f26..5e8e902 100644 (file)
@@ -1674,10 +1674,10 @@ static int ims_pcu_init_application_mode(struct ims_pcu *pcu)
 
        return 0;
 
-err_destroy_backlight:
-       ims_pcu_destroy_backlight(pcu);
 err_destroy_buttons:
        ims_pcu_destroy_buttons(pcu);
+err_destroy_backlight:
+       ims_pcu_destroy_backlight(pcu);
        return error;
 }