net: thunderx: Fix the ACPI memory leak
authorYu Liao <liaoyu15@huawei.com>
Wed, 23 Nov 2022 08:22:36 +0000 (16:22 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 Dec 2022 16:41:07 +0000 (17:41 +0100)
commit592b6fd74afd6afb5a6ef238625fa6ced8338db2
treeea623c031482e00e7c71aaa292a9695e4983c8a9
parent697eb30a353441dd590e4a71bc93f9e3fbc4f20b
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@huawei.com>
Link: https://lore.kernel.org/r/20221123082237.1220521-1-liaoyu15@huawei.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/cavium/thunder/thunder_bgx.c