public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Randy Dunlap <randy.dunlap@oracle.com>
To: Anisse Astier <anisse@astier.eu>
Cc: linux-acpi@vger.kernel.org,
	Carlos Corbacho <carlos@strangeworlds.co.uk>,
	Len Brown <lenb@kernel.org>, Frans Pop <elendil@planet.nl>,
	Matthew Garrett <mjg@redhat.com>
Subject: Re: [PATCH v2] wmi: Free the allocated acpi objects through wmi_get_event_data
Date: Fri, 4 Dec 2009 08:04:36 -0800	[thread overview]
Message-ID: <20091204080436.cfebb82a.randy.dunlap@oracle.com> (raw)
In-Reply-To: <20091204101009.0dccacf3@destiny.ordissimo>

On Fri, 4 Dec 2009 10:10:09 +0100 Anisse Astier wrote:

> 
> These function allocate an acpi object by calling wmi_get_event_data, which
> then calls acpi_evaluate_object, and it is not freed afterwards.
> 
> And kernel doc is fixed for parameters of wmi_get_event_data.
> 
> Signed-off-by: Anisse Astier <anisse@astier.eu>

Ack and thanks for doing that.


> ---
> There it is,
> 
> Fixed the kernel doc in this patch.
> 
> Anisse
> 
>  drivers/platform/x86/dell-wmi.c |    1 +
>  drivers/platform/x86/hp-wmi.c   |    2 ++
>  drivers/platform/x86/wmi.c      |    4 ++--
>  3 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/platform/x86/dell-wmi.c b/drivers/platform/x86/dell-wmi.c
> index 0f900cc..f235a98 100644
> --- a/drivers/platform/x86/dell-wmi.c
> +++ b/drivers/platform/x86/dell-wmi.c
> @@ -180,6 +180,7 @@ static void dell_wmi_notify(u32 value, void *context)
>  			printk(KERN_INFO "dell-wmi: Unknown key %x pressed\n",
>  			       buffer[1] & 0xFFFF);
>  	}
> +	kfree(obj);
>  }
>  
>  static int __init dell_wmi_input_setup(void)
> diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c
> index c284217..36109e1 100644
> --- a/drivers/platform/x86/hp-wmi.c
> +++ b/drivers/platform/x86/hp-wmi.c
> @@ -377,6 +377,8 @@ static void hp_wmi_notify(u32 value, void *context)
>  			       eventcode);
>  	} else
>  		printk(KERN_INFO "HP WMI: Unknown response received\n");
> +
> +	kfree(obj);
>  }
>  
>  static int __init hp_wmi_input_setup(void)
> diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
> index 177f8d7..87f4c97 100644
> --- a/drivers/platform/x86/wmi.c
> +++ b/drivers/platform/x86/wmi.c
> @@ -510,8 +510,8 @@ EXPORT_SYMBOL_GPL(wmi_remove_notify_handler);
>  /**
>   * wmi_get_event_data - Get WMI data associated with an event
>   *
> - * @event - Event to find
> - * &out - Buffer to hold event data
> + * @event: Event to find
> + * @out: Buffer to hold event data. out->pointer should be freed with kfree()
>   *
>   * Returns extra data associated with an event in WMI.
>   */
> -- 
> 1.6.5.3
> 


---
~Randy

      reply	other threads:[~2009-12-04 16:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-03 16:27 [PATCH] wmi: Free the allocated acpi objects through wmi_get_event_data Anisse Astier
2009-12-03 16:37 ` Matthew Garrett
2009-12-03 18:01 ` Randy Dunlap
2009-12-04  9:10   ` [PATCH v2] " Anisse Astier
2009-12-04 16:04     ` Randy Dunlap [this message]

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=20091204080436.cfebb82a.randy.dunlap@oracle.com \
    --to=randy.dunlap@oracle.com \
    --cc=anisse@astier.eu \
    --cc=carlos@strangeworlds.co.uk \
    --cc=elendil@planet.nl \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=mjg@redhat.com \
    /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