From patchwork Thu Aug 11 09:28:46 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ike Panhc X-Patchwork-Id: 109578 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 53CE0B6F98 for ; Thu, 11 Aug 2011 19:29:00 +1000 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1QrRZM-0007hR-Tb; Thu, 11 Aug 2011 09:28:52 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1QrRZK-0007gR-In for kernel-team@lists.ubuntu.com; Thu, 11 Aug 2011 09:28:50 +0000 Received: from [210.242.151.101] (helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1QrRZJ-0008JR-V1 for kernel-team@lists.ubuntu.com; Thu, 11 Aug 2011 09:28:50 +0000 From: Ike Panhc To: kernel-team@lists.ubuntu.com Subject: [PATCH 4/4] (drop after 3.0) ideapad: add missing ideapad_input_exit in ideapad_acpi_add error path Date: Thu, 11 Aug 2011 17:28:46 +0800 Message-Id: <1313054926-3608-1-git-send-email-ike.pan@canonical.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1313054850-3465-1-git-send-email-ike.pan@canonical.com> References: <1313054850-3465-1-git-send-email-ike.pan@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com From: Axel Lin 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 (cherry picked from mainline commit 7451a55af08d40fd6b28802f4e26a13264114430) Signed-off-by: Ike Panhc --- drivers/platform/x86/ideapad-laptop.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c index 8811c68..0c59541 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: