diff options
author | Hans de Goede <hdegoede@redhat.com> | 2021-08-26 17:08:22 +0300 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2021-08-26 17:09:43 +0300 |
commit | 0487d4fc42d7f31a56cfd9e2237f9ebd889e6112 (patch) | |
tree | e13e56c0d08fb682952301ea3ad8de347d6d803b /drivers/platform/x86/dell | |
parent | fb49d9946f96081f9a05d8f305b3f40285afe4a9 (diff) | |
download | linux-0487d4fc42d7f31a56cfd9e2237f9ebd889e6112.tar.xz |
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: 1a258e670434 ("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
Diffstat (limited to 'drivers/platform/x86/dell')
-rw-r--r-- | drivers/platform/x86/dell/dell-smbios-wmi.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/platform/x86/dell/dell-smbios-wmi.c b/drivers/platform/x86/dell/dell-smbios-wmi.c index 01ea4bb958af..931cc50136de 100644 --- a/drivers/platform/x86/dell/dell-smbios-wmi.c +++ b/drivers/platform/x86/dell/dell-smbios-wmi.c @@ -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); |