platform/x86: mxm-wmi: fix memleak in mxm_wmi_call_mx[ds|mx]()
authorYu Liao <liaoyu15@huawei.com>
Tue, 29 Nov 2022 01:11:01 +0000 (09:11 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:32:00 +0000 (13:32 +0100)
commit87426ce3bd57ad414b6e2436434ef8128986a9a5
tree20dbd2e0cd772c398277e79f2c9a141e9cd82b5f
parent6613f36a2fa5c69e528bccba8b3d831f759dad2f
platform/x86: mxm-wmi: fix memleak in mxm_wmi_call_mx[ds|mx]()

[ Upstream commit 727cc0147f5066e359aca65cc6cc5e6d64cc15d8 ]

The ACPI buffer memory (out.pointer) returned by wmi_evaluate_method()
is not freed after the call, so it leads to memory leak.

The method results in ACPI buffer is not used, so just pass NULL to
wmi_evaluate_method() which fixes the memory leak.

Fixes: 99b38b4acc0d ("platform/x86: add MXM WMI driver.")
Signed-off-by: Yu Liao <liaoyu15@huawei.com>
Link: https://lore.kernel.org/r/20221129011101.2042315-1-liaoyu15@huawei.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/platform/x86/mxm-wmi.c