public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] wmi: Free the allocated acpi objects through wmi_get_event_data
@ 2009-12-03 16:27 Anisse Astier
  2009-12-03 16:37 ` Matthew Garrett
  2009-12-03 18:01 ` Randy Dunlap
  0 siblings, 2 replies; 5+ messages in thread
From: Anisse Astier @ 2009-12-03 16:27 UTC (permalink / raw)
  To: linux-acpi; +Cc: Carlos Corbacho, Len Brown, Frans Pop, Matthew Garrett


These function allocate an acpi object by calling wmi_get_event_data, which
then calls acpi_evaluate_object, and it is not freed afterwards

Signed-off-by: Anisse Astier <anisse@astier.eu>
---
 drivers/platform/x86/dell-wmi.c |    1 +
 drivers/platform/x86/hp-wmi.c   |    2 ++
 drivers/platform/x86/wmi.c      |    2 +-
 3 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/platform/x86/dell-wmi.c b/drivers/platform/x86/dell-wmi.c
index 5f4a0e6..cd48a2f 100644
--- a/drivers/platform/x86/dell-wmi.c
+++ b/drivers/platform/x86/dell-wmi.c
@@ -121,6 +121,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 8868610..8eba327 100644
--- a/drivers/platform/x86/hp-wmi.c
+++ b/drivers/platform/x86/hp-wmi.c
@@ -316,6 +316,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..b486048 100644
--- a/drivers/platform/x86/wmi.c
+++ b/drivers/platform/x86/wmi.c
@@ -511,7 +511,7 @@ 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
+ * &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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] wmi: Free the allocated acpi objects through wmi_get_event_data
  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
  1 sibling, 0 replies; 5+ messages in thread
From: Matthew Garrett @ 2009-12-03 16:37 UTC (permalink / raw)
  To: Anisse Astier; +Cc: linux-acpi, Carlos Corbacho, Len Brown, Frans Pop

On Thu, Dec 03, 2009 at 05:27:45PM +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
> 
> Signed-off-by: Anisse Astier <anisse@astier.eu>
Acked-by: Matthew Garrett <mjg@redhat.com>

-- 
Matthew Garrett | mjg59@srcf.ucam.org

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] wmi: Free the allocated acpi objects through wmi_get_event_data
  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
  1 sibling, 1 reply; 5+ messages in thread
From: Randy Dunlap @ 2009-12-03 18:01 UTC (permalink / raw)
  To: Anisse Astier
  Cc: linux-acpi, Carlos Corbacho, Len Brown, Frans Pop,
	Matthew Garrett

On Thu, 3 Dec 2009 17:27:45 +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
> 
> Signed-off-by: Anisse Astier <anisse@astier.eu>
> ---
>  drivers/platform/x86/dell-wmi.c |    1 +
>  drivers/platform/x86/hp-wmi.c   |    2 ++
>  drivers/platform/x86/wmi.c      |    2 +-
>  3 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/platform/x86/dell-wmi.c b/drivers/platform/x86/dell-wmi.c
> index 5f4a0e6..cd48a2f 100644
> --- a/drivers/platform/x86/dell-wmi.c
> +++ b/drivers/platform/x86/dell-wmi.c
> @@ -121,6 +121,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 8868610..8eba327 100644
> --- a/drivers/platform/x86/hp-wmi.c
> +++ b/drivers/platform/x86/hp-wmi.c
> @@ -316,6 +316,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..b486048 100644
> --- a/drivers/platform/x86/wmi.c
> +++ b/drivers/platform/x86/wmi.c
> @@ -511,7 +511,7 @@ 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
> + * &out - Buffer to hold event data. out.pointer should be freed with kfree()
>   *
>   * Returns extra data associated with an event in WMI.
>   */
> -- 

Hi,

All of the kernel-doc in wmi.c is in the correct format except for this (above)
function.  Please fix it to use the expected kernel-doc notation:

 * @event: Event to find
 * @out: Buffer to hold event data. out.pointer should be freed with kfree()


thanks,
---
~Randy

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2] wmi: Free the allocated acpi objects through wmi_get_event_data
  2009-12-03 18:01 ` Randy Dunlap
@ 2009-12-04  9:10   ` Anisse Astier
  2009-12-04 16:04     ` Randy Dunlap
  0 siblings, 1 reply; 5+ messages in thread
From: Anisse Astier @ 2009-12-04  9:10 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: linux-acpi, Carlos Corbacho, Len Brown, Frans Pop,
	Matthew Garrett


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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] wmi: Free the allocated acpi objects through wmi_get_event_data
  2009-12-04  9:10   ` [PATCH v2] " Anisse Astier
@ 2009-12-04 16:04     ` Randy Dunlap
  0 siblings, 0 replies; 5+ messages in thread
From: Randy Dunlap @ 2009-12-04 16:04 UTC (permalink / raw)
  To: Anisse Astier
  Cc: linux-acpi, Carlos Corbacho, Len Brown, Frans Pop,
	Matthew Garrett

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-12-04 16:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox