Skip to content

Commit

Permalink
WMI: do not leak memory in parse_wdg()
Browse files Browse the repository at this point in the history
If we _WDG returned object that is not buffer we were forgetting
to free memory allocated for that object.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
  • Loading branch information
Dmitry Torokhov authored and Matthew Garrett committed Oct 21, 2010
1 parent 4e4304d commit 64ed0ab
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/platform/x86/wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 64ed0ab

Please sign in to comment.