Patch "platform/x86: mxm-wmi: fix memleak in mxm_wmi_call_mx[ds|mx]()" has been added to the 4.14-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    platform/x86: mxm-wmi: fix memleak in mxm_wmi_call_mx[ds|mx]()

to the 4.14-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     platform-x86-mxm-wmi-fix-memleak-in-mxm_wmi_call_mx-.patch
and it can be found in the queue-4.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 3103bded838a2f76a81948a23c3c8c5ec2dc52ed
Author: Yu Liao <liaoyu15@xxxxxxxxxx>
Date:   Tue Nov 29 09:11:01 2022 +0800

    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@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20221129011101.2042315-1-liaoyu15@xxxxxxxxxx
    Reviewed-by: Hans de Goede <hdegoede@xxxxxxxxxx>
    Signed-off-by: Hans de Goede <hdegoede@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/platform/x86/mxm-wmi.c b/drivers/platform/x86/mxm-wmi.c
index 35d8b9a939f9..9c1893a703e6 100644
--- a/drivers/platform/x86/mxm-wmi.c
+++ b/drivers/platform/x86/mxm-wmi.c
@@ -48,13 +48,11 @@ int mxm_wmi_call_mxds(int adapter)
 		.xarg = 1,
 	};
 	struct acpi_buffer input = { (acpi_size)sizeof(args), &args };
-	struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL };
 	acpi_status status;
 
 	printk("calling mux switch %d\n", adapter);
 
-	status = wmi_evaluate_method(MXM_WMMX_GUID, 0x0, adapter, &input,
-				     &output);
+	status = wmi_evaluate_method(MXM_WMMX_GUID, 0x0, adapter, &input, NULL);
 
 	if (ACPI_FAILURE(status))
 		return status;
@@ -73,13 +71,11 @@ int mxm_wmi_call_mxmx(int adapter)
 		.xarg = 1,
 	};
 	struct acpi_buffer input = { (acpi_size)sizeof(args), &args };
-	struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL };
 	acpi_status status;
 
 	printk("calling mux switch %d\n", adapter);
 
-	status = wmi_evaluate_method(MXM_WMMX_GUID, 0x0, adapter, &input,
-				     &output);
+	status = wmi_evaluate_method(MXM_WMMX_GUID, 0x0, adapter, &input, NULL);
 
 	if (ACPI_FAILURE(status))
 		return status;



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux