summaryrefslogtreecommitdiff
path: root/net/core
diff options
context:
space:
mode:
authorJianpeng Chang <jianpeng.chang.cn@windriver.com>2026-01-20 09:55:24 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-02-26 15:00:48 -0800
commite144cce29851610ce9c6eda405ce21118779aa51 (patch)
tree7945becf5a54c3e35d36b0cb0655fe5fbf8b5ec4 /net/core
parentce36469987d6550551669f95c07978da17425165 (diff)
crypto: caam - fix netdev memory leak in dpaa2_caam_probe
[ Upstream commit 7d43252b3060b0ba4a192dce5dba85a3f39ffe39 ] When commit 0e1a4d427f58 ("crypto: caam: Unembed net_dev structure in dpaa2") converted embedded net_device to dynamically allocated pointers, it added cleanup in dpaa2_dpseci_disable() but missed adding cleanup in dpaa2_dpseci_free() for error paths. This causes memory leaks when dpaa2_dpseci_dpio_setup() fails during probe due to DPIO devices not being ready yet. The kernel's deferred probe mechanism handles the retry successfully, but the netdevs allocated during the failed probe attempt are never freed, resulting in kmemleak reports showing multiple leaked netdev-related allocations all traced back to dpaa2_caam_probe(). Fix this by preserving the CPU mask of allocated netdevs during setup and using it for cleanup in dpaa2_dpseci_free(). This approach ensures that only the CPUs that actually had netdevs allocated will be cleaned up, avoiding potential issues with CPU hotplug scenarios. Fixes: 0e1a4d427f58 ("crypto: caam: Unembed net_dev structure in dpaa2") Signed-off-by: Jianpeng Chang <jianpeng.chang.cn@windriver.com> Reviewed-by: Breno Leitao <leitao@debian.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net/core')
0 files changed, 0 insertions, 0 deletions