Skip to contentSkip to conversation

eeepc-laptop: fix rfkill memory leak on unload

PATCH New Alan Jenkins 1 participant 1 message Aug 19, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 eeepc-laptop: fix rfkill memory leak on unload

rfkill_unregister() should always be followed by rfkill_destroy()

---
 drivers/platform/x86/eeepc-laptop.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
drivers/platform/x86/eeepc-laptop.c +7 -2
index 1c94860..36d613b 100644
@@ -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);
+	}
 }