Commit 0487d4fc authored by Hans de Goede's avatar Hans de Goede

platform/x86: dell-smbios-wmi: Add missing kfree in error-exit from run_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: 1a258e67 ("platform/x86: dell-smbios-wmi: Add new WMI dispatcher driver")
Reported-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210826140822.71198-1-hdegoede@redhat.com
parent fb49d994
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment