Skip to content

Commit

Permalink
platform/x86: dell-smbios-wmi: Add missing kfree in error-exit from r…
Browse files Browse the repository at this point in the history
…un_smbios_call

As pointed out be Kees Cook if we return -EIO because the
obj->type != ACPI_TYPE_BUFFER, then we must kfree the
output buffer before the return.

Fixes: 1a258e6 ("platform/x86: dell-smbios-wmi: Add new WMI dispatcher driver")
Reported-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210826140822.71198-1-hdegoede@redhat.com
  • Loading branch information
jwrdegoede committed Aug 26, 2021
1 parent fb49d99 commit 0487d4f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/platform/x86/dell/dell-smbios-wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ static int run_smbios_call(struct wmi_device *wdev)
if (obj->type == ACPI_TYPE_INTEGER)
dev_dbg(&wdev->dev, "SMBIOS call failed: %llu\n",
obj->integer.value);
kfree(output.pointer);
return -EIO;
}
memcpy(input.pointer, obj->buffer.pointer, obj->buffer.length);
Expand Down

0 comments on commit 0487d4f

Please sign in to comment.