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)
committerHans de Goede <hdegoede@redhat.com>
Thu, 8 Dec 2022 15:32:12 +0000 (16:32 +0100)
commit727cc0147f5066e359aca65cc6cc5e6d64cc15d8
tree7121d20633e71248e3abc1510039197275768247
parentb03ae77e7e057f4b3b858f10c840557e71448a91
platform/x86: mxm-wmi: fix memleak in mxm_wmi_call_mx[ds|mx]()

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>
drivers/platform/x86/mxm-wmi.c