linux-stable/drivers/net/fjes
Zhipeng Lu 20b98e3c49 fjes: fix memleaks in fjes_hw_setup
[ Upstream commit f6cc4b6a3a ]

In fjes_hw_setup, it allocates several memory and delay the deallocation
to the fjes_hw_exit in fjes_probe through the following call chain:

fjes_probe
  |-> fjes_hw_init
        |-> fjes_hw_setup
  |-> fjes_hw_exit

However, when fjes_hw_setup fails, fjes_hw_exit won't be called and thus
all the resources allocated in fjes_hw_setup will be leaked. In this
patch, we free those resources in fjes_hw_setup and prevents such leaks.

Fixes: 2fcbca6877 ("fjes: platform_driver's .probe and .remove routine")
Signed-off-by: Zhipeng Lu <alexious@zju.edu.cn>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/20240122172445.3841883-1-alexious@zju.edu.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-01-31 16:19:05 -08:00
..
Makefile
fjes.h
fjes_debugfs.c fjes: no need to check return value of debugfs_create functions 2019-06-22 16:43:08 -07:00
fjes_ethtool.c net: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:07 -07:00
fjes_hw.c fjes: fix memleaks in fjes_hw_setup 2024-01-31 16:19:05 -08:00
fjes_hw.h net: fjes: constify and use eth_hw_addr_set() 2021-10-22 10:16:07 -07:00
fjes_main.c ACPI: make remove callback of ACPI driver void 2022-11-23 19:11:22 +01:00
fjes_regs.h
fjes_trace.c
fjes_trace.h treewide: Add missing semicolons to __assign_str uses 2021-06-30 09:19:14 -04:00