wmi: Free the allocated acpi objects through wmi_get_event_data
Subsystems (2)
PATCH 1/1 wmi: Free the allocated acpi objects through wmi_get_event_data
These function allocate an acpi object by calling wmi_get_event_data, which then calls acpi_evaluate_object, and it is not freed afterwards
--- 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(-)
drivers/platform/x86/dell-wmi.c +1 -0
@@ -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 )
drivers/platform/x86/hp-wmi.c +2 -0
@@ -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 )
drivers/platform/x86/wmi.c +1 -1
@@ -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. */
Signature · 1 line
1.6.5.3
Quoted 5 lines · Anisse Astier
These function allocate an acpi object by calling
wmi_get_event_data, which then callsacpi_evaluate_object, and it is not freed afterwardsSigned-off-by Anisse Astier <[email protected]>
Signature · 1 line
Matthew Garrett | [email protected]
Quoted 42 lines · 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 callsacpi_evaluate_object, and it is not freed afterwardsSigned-off-by Anisse Astier <[email protected]>--- 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(-)drivers/platform/x86/dell-wmi.c +1
-0@@ -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 )drivers/platform/x86/hp-wmi.c +2
-0@@ -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 )drivers/platform/x86/wmi.c +0
-0
drivers/platform/x86/wmi.c EXPORT_SYMBOL_GPL(wmi_remove_notify_handler); · line 517
Quoted 8 lines
drivers/platform/x86/wmi.c +1
-1@@ -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
PATCH v2 1/1 wmi: Free the allocated acpi objects through wmi_get_event_data
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.
---
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(-)
drivers/platform/x86/dell-wmi.c +1 -0
@@ -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 )
drivers/platform/x86/hp-wmi.c +2 -0
@@ -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 )
drivers/platform/x86/wmi.c +2 -2
@@ -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. */
Signature · 1 line
1.6.5.3
Quoted 7 lines · 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 callsacpi_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 <[email protected]>
Ack and thanks for doing that.
Quoted 55 lines
---
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(-)drivers/platform/x86/dell-wmi.c +1
-0@@ -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 )drivers/platform/x86/hp-wmi.c +2
-0@@ -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 )drivers/platform/x86/wmi.c +2
-2@@ -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. */ Signature · 1 line
1.6.5.3
---
~Randy