From 64ed0ab8d060d28a7787de29c76178c2efc1dd65 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Thu, 26 Aug 2010 00:14:58 -0700 Subject: WMI: do not leak memory in parse_wdg() If we _WDG returned object that is not buffer we were forgetting to free memory allocated for that object. Signed-off-by: Dmitry Torokhov Signed-off-by: Matthew Garrett --- drivers/platform/x86/wmi.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c index 88ce87c74e27..a24a4b52c919 100644 --- a/drivers/platform/x86/wmi.c +++ b/drivers/platform/x86/wmi.c @@ -825,8 +825,10 @@ static acpi_status parse_wdg(acpi_handle handle) obj = (union acpi_object *) out.pointer; - if (obj->type != ACPI_TYPE_BUFFER) - return AE_ERROR; + if (obj->type != ACPI_TYPE_BUFFER) { + status = AE_ERROR; + goto out_free_pointer; + } total = obj->buffer.length / sizeof(struct guid_block); -- cgit v1.2.3