From: Axel Lin Date: Wed, 27 Jul 2011 07:27:34 +0000 (+0800) Subject: platform-drivers-x86: ideapad-laptop: add missing ideapad_input_exit in ideapad_acpi_... X-Git-Tag: firefly_0821_release~3680^2~4706^2~2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7451a55af08d40fd6b28802f4e26a13264114430;p=firefly-linux-kernel-4.4.55.git platform-drivers-x86: ideapad-laptop: add missing ideapad_input_exit in ideapad_acpi_add error path In the case of ideapad_backlight_init() failure, we need to free the resources allocated by ideapad_input_init(). Aslo drop __devexit annotation for ideapad_input_exit() because we also call it in ideapad_acpi_add() error path. Signed-off-by: Axel Lin Signed-off-by: Matthew Garrett --- diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c index 8811c68f809d..0c595410e788 100644 --- a/drivers/platform/x86/ideapad-laptop.c +++ b/drivers/platform/x86/ideapad-laptop.c @@ -406,7 +406,7 @@ err_free_dev: return error; } -static void __devexit ideapad_input_exit(struct ideapad_private *priv) +static void ideapad_input_exit(struct ideapad_private *priv) { sparse_keymap_free(priv->inputdev); input_unregister_device(priv->inputdev); @@ -563,6 +563,7 @@ static int __devinit ideapad_acpi_add(struct acpi_device *adevice) backlight_failed: for (i = 0; i < IDEAPAD_RFKILL_DEV_NUM; i++) ideapad_unregister_rfkill(adevice, i); + ideapad_input_exit(priv); input_failed: ideapad_platform_exit(priv); platform_failed: