1
0
Fork 0

eeepc-laptop: fix rfkill memory leak on unload

rfkill_unregister() should always be followed by rfkill_destroy()

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>
hifive-unleashed-5.1
Alan Jenkins 2009-08-29 10:28:30 +02:00 committed by Len Brown
parent be96666065
commit a825806979
1 changed files with 13 additions and 3 deletions

View File

@ -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)