Skip to contentSkip to conversation

wmi: Free the allocated acpi objects through wmi_get_event_data

PATCH RESEND Applied Anisse Astier 3 participants 3 messages Dec 15, 2009 – Dec 24, 2009

Subsystems (2)

v1 of 2 Applied Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 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.

---
Hi,
I didn't see this patch merged in any tree yet, so I'm resending it with the added acked-bys.

Regards,

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
index 0f900cc..f235a98 100644
@@ -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
index c284217..36109e1 100644
@@ -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
index 177f8d7..87f4c97 100644
@@ -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
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · On Tuesday 15 December 2009 09:50:24 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.

For the wmi.c changes:

Len, can you just take this directly?

-Carlos

Signature · 3 lines
E-Mail: [email protected]
Web: strangeworlds.co.uk
GPG Key ID: 0x23EE722D
reviewer Applied
#2 lore raw

applied

thanks,
Len Brown, Intel Open Source Technology Center