From patchwork Sat Aug 29 08:28:30 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Chary X-Patchwork-Id: 44677 X-Patchwork-Delegate: lenb@kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n7T8TdT9029183 for ; Sat, 29 Aug 2009 08:29:40 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750997AbZH2I3e (ORCPT ); Sat, 29 Aug 2009 04:29:34 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751195AbZH2I3e (ORCPT ); Sat, 29 Aug 2009 04:29:34 -0400 Received: from smtp23.services.sfr.fr ([93.17.128.20]:59672 "EHLO smtp23.services.sfr.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750997AbZH2I3d (ORCPT ); Sat, 29 Aug 2009 04:29:33 -0400 Received: from filter.sfr.fr (localhost [127.0.0.1]) by msfrf2326.sfr.fr (SMTP Server) with ESMTP id 0D673700009E; Sat, 29 Aug 2009 10:29:33 +0200 (CEST) Received: from localhost.localdomain (27.14.98-84.rev.gaoland.net [84.98.14.27]) by msfrf2326.sfr.fr (SMTP Server) with ESMTP id 770D0700009B; Sat, 29 Aug 2009 10:29:32 +0200 (CEST) X-SFR-UUID: 20090829082932487.770D0700009B@msfrf2326.sfr.fr From: Corentin Chary To: lenb@kernel.org Cc: linux-acpi@vger.kernel.org, alan-jenkins@tuffmail.co.uk, Corentin Chary Subject: [PATCH 2/3] eeepc-laptop: fix rfkill memory leak on unload Date: Sat, 29 Aug 2009 10:28:30 +0200 Message-Id: <1251534511-8479-2-git-send-email-corentincj@iksaif.net> X-Mailer: git-send-email 1.6.4.1 In-Reply-To: <1251534511-8479-1-git-send-email-corentincj@iksaif.net> References: <1251534511-8479-1-git-send-email-corentincj@iksaif.net> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org From: Alan Jenkins rfkill_unregister() should always be followed by rfkill_destroy() Signed-off-by: Alan Jenkins Signed-off-by: Corentin Chary --- drivers/platform/x86/eeepc-laptop.c | 16 +++++++++++++--- 1 files changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c index 819c685..6f9a448 100644 --- a/drivers/platform/x86/eeepc-laptop.c +++ b/drivers/platform/x86/eeepc-laptop.c @@ -985,6 +985,7 @@ static void eeepc_rfkill_exit(void) eeepc_unregister_rfkill_notifier("\\_SB.PCI0.P0P7"); if (ehotk->wlan_rfkill) { rfkill_unregister(ehotk->wlan_rfkill); + rfkill_destroy(ehotk->wlan_rfkill); ehotk->wlan_rfkill = NULL; } /* @@ -995,12 +996,21 @@ static void eeepc_rfkill_exit(void) if (ehotk->hotplug_slot) pci_hp_deregister(ehotk->hotplug_slot); - if (ehotk->bluetooth_rfkill) + if (ehotk->bluetooth_rfkill) { rfkill_unregister(ehotk->bluetooth_rfkill); - if (ehotk->wwan3g_rfkill) + rfkill_destroy(ehotk->bluetooth_rfkill); + ehotk->bluetooth_rfkill = NULL; + } + if (ehotk->wwan3g_rfkill) { rfkill_unregister(ehotk->wwan3g_rfkill); - if (ehotk->wimax_rfkill) + rfkill_destroy(ehotk->wwan3g_rfkill); + ehotk->wwan3g_rfkill = NULL; + } + if (ehotk->wimax_rfkill) { rfkill_unregister(ehotk->wimax_rfkill); + rfkill_destroy(ehotk->wimax_rfkill); + ehotk->wimax_rfkill = NULL; + } } static void eeepc_input_exit(void)