linux/drivers/net/fjes
Zhipeng Lu f6cc4b6a3a fjes: fix memleaks in fjes_hw_setup
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>
2024-01-24 18:03:53 -08:00
..
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-24 18:03:53 -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 net: fjes: Convert to platform remove callback returning void 2023-12-05 19:51:09 -08:00
fjes_regs.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 308 2019-06-05 17:37:04 +02:00
fjes_trace.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 308 2019-06-05 17:37:04 +02:00
fjes_trace.h treewide: Add missing semicolons to __assign_str uses 2021-06-30 09:19:14 -04:00
fjes.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 308 2019-06-05 17:37:04 +02:00
Makefile treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 308 2019-06-05 17:37:04 +02:00