diff options
| author | Hans de Goede <hdegoede@redhat.com> | 2021-08-26 16:08:22 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-09-22 12:26:25 +0200 |
| commit | e2e3758a2cf90b19f550ab460487d2310d3df43d (patch) | |
| tree | 23d58b518a5512ceeeafe6fce7078bce837de8d9 /drivers/platform | |
| parent | ba5d4dc003b40e7c2cbe3cbcaff4c117bdff4f2a (diff) | |
| download | linux-e2e3758a2cf90b19f550ab460487d2310d3df43d.tar.gz linux-e2e3758a2cf90b19f550ab460487d2310d3df43d.tar.bz2 linux-e2e3758a2cf90b19f550ab460487d2310d3df43d.zip | |
platform/x86: dell-smbios-wmi: Add missing kfree in error-exit from run_smbios_call
[ Upstream commit 0487d4fc42d7f31a56cfd9e2237f9ebd889e6112 ]
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
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/platform')
| -rw-r--r-- | drivers/platform/x86/dell-smbios-wmi.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/platform/x86/dell-smbios-wmi.c b/drivers/platform/x86/dell-smbios-wmi.c index c97bd4a45242..5821e9d9a4ce 100644 --- a/drivers/platform/x86/dell-smbios-wmi.c +++ b/drivers/platform/x86/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(&priv->buf->std, obj->buffer.pointer, obj->buffer.length); |
