platform/x86: dell-smbios-wmi: Add missing kfree in error-exit from run_smbios_call
authorHans de Goede <hdegoede@redhat.com>
Thu, 26 Aug 2021 14:08:22 +0000 (16:08 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 18 Sep 2021 11:40:15 +0000 (13:40 +0200)
commit903ca538f5882404f7764c3c93b5c82c4794a288
treec7f4c858494b237f4a76f8f855d5cf32cd9494a2
parentadd8e8c3402f3bb54c66716b23544d2ef289a79d
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>
drivers/platform/x86/dell-smbios-wmi.c