diff mbox

[2/3] thinkpad_acpi: fix rfkill memory leak on unload

Message ID 1252925033-29696-3-git-send-email-corentincj@iksaif.net (mailing list archive)
State Accepted
Delegated to: Len Brown
Headers show

Commit Message

Corentin Chary Sept. 14, 2009, 10:43 a.m. UTC
rfkill_unregister() should always be followed by rfkill_destroy()

Cc: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
---
 drivers/platform/x86/thinkpad_acpi.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Comments

Henrique de Moraes Holschuh Sept. 14, 2009, 1:22 p.m. UTC | #1
On Mon, 14 Sep 2009, Corentin Chary wrote:
> rfkill_unregister() should always be followed by rfkill_destroy()
> 
> Cc: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
> Signed-off-by: Corentin Chary <corentincj@iksaif.net>

Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: stable@kernel.org

> ---
>  drivers/platform/x86/thinkpad_acpi.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
> index e856008..21c9715 100644
> --- a/drivers/platform/x86/thinkpad_acpi.c
> +++ b/drivers/platform/x86/thinkpad_acpi.c
> @@ -1278,6 +1278,7 @@ static void tpacpi_destroy_rfkill(const enum tpacpi_rfk_id id)
>  	tp_rfk = tpacpi_rfkill_switches[id];
>  	if (tp_rfk) {
>  		rfkill_unregister(tp_rfk->rfkill);
> +		rfkill_destroy(tp_rfk->rfkill);
>  		tpacpi_rfkill_switches[id] = NULL;
>  		kfree(tp_rfk);
>  	}
Len Brown Sept. 19, 2009, 5:10 a.m. UTC | #2
applied

thanks,
Len Brown, Intel Open Source Technology Center

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index e856008..21c9715 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -1278,6 +1278,7 @@  static void tpacpi_destroy_rfkill(const enum tpacpi_rfk_id id)
 	tp_rfk = tpacpi_rfkill_switches[id];
 	if (tp_rfk) {
 		rfkill_unregister(tp_rfk->rfkill);
+		rfkill_destroy(tp_rfk->rfkill);
 		tpacpi_rfkill_switches[id] = NULL;
 		kfree(tp_rfk);
 	}