From: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
To: Corentin Chary <corentin.chary@gmail.com>
Cc: linux acpi <linux-acpi@vger.kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH 1/2] eeepc-laptop: fix rfkill memory leak on unload
Date: Wed, 19 Aug 2009 10:38:57 +0100 [thread overview]
Message-ID: <4A8BC831.8050708@tuffmail.co.uk> (raw)
rfkill_unregister() should always be followed by rfkill_destroy()
Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
---
drivers/platform/x86/eeepc-laptop.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c
index 1c94860..36d613b 100644
--- a/drivers/platform/x86/eeepc-laptop.c
+++ b/drivers/platform/x86/eeepc-laptop.c
@@ -981,6 +981,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;
}
/*
@@ -991,10 +992,14 @@ 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);
+ }
+ if (ehotk->wwan3g_rfkill) {
rfkill_unregister(ehotk->wwan3g_rfkill);
+ rfkill_destroy(ehotk->wwan3g_rfkill);
+ }
}
reply other threads:[~2009-08-19 9:39 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A8BC831.8050708@tuffmail.co.uk \
--to=alan-jenkins@tuffmail.co.uk \
--cc=corentin.chary@gmail.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox