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:14:05 +0000 (13:14 +0100)
commit3cf81501356c9e898ad94b2369ffc805f83f7d7b
treeef60ee3442604417338c15c73ac56ae60c744dd9
parent0ceadb5a3e45f1b81cf54bd496b40a5e50b6bd40
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