Patch "net: thunderx: Fix the ACPI memory leak" has been added to the 5.4-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

    net: thunderx: Fix the ACPI memory leak

to the 5.4-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:
     net-thunderx-fix-the-acpi-memory-leak.patch
and it can be found in the queue-5.4 subdirectory.

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



commit 393a337188a7ef32b77aef80e801229d38410404
Author: Yu Liao <liaoyu15@xxxxxxxxxx>
Date:   Wed Nov 23 16:22:36 2022 +0800

    net: thunderx: Fix the ACPI memory leak
    
    [ Upstream commit 661e5ebbafd26d9d2e3c749f5cf591e55c7364f5 ]
    
    The ACPI buffer memory (string.pointer) should be freed as the buffer is
    not used after returning from bgx_acpi_match_id(), free it to prevent
    memory leak.
    
    Fixes: 46b903a01c05 ("net, thunder, bgx: Add support to get MAC address from ACPI.")
    Signed-off-by: Yu Liao <liaoyu15@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20221123082237.1220521-1-liaoyu15@xxxxxxxxxx
    Signed-off-by: Paolo Abeni <pabeni@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
index 76ff42ec3ae5..a34c33e8a8ad 100644
--- a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
+++ b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
@@ -1438,8 +1438,10 @@ static acpi_status bgx_acpi_match_id(acpi_handle handle, u32 lvl,
 		return AE_OK;
 	}
 
-	if (strncmp(string.pointer, bgx_sel, 4))
+	if (strncmp(string.pointer, bgx_sel, 4)) {
+		kfree(string.pointer);
 		return AE_OK;
+	}
 
 	acpi_walk_namespace(ACPI_TYPE_DEVICE, handle, 1,
 			    bgx_acpi_register_phy, NULL, bgx, NULL);



[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