mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-28 13:22:57 +00:00
net: thunderx: Fix the ACPI memory leak
[ Upstream commit661e5ebbaf
] 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:46b903a01c
("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>
This commit is contained in:
parent
06c448957e
commit
b9ce97f40b
1 changed files with 3 additions and 1 deletions
|
@ -1436,8 +1436,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);
|
||||
|
|
Loading…
Reference in a new issue