linux-stable/drivers/net/fjes
Zhipeng Lu 5b1086d226 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:17:06 -08:00
..
fjes.h
fjes_debugfs.c
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:17:06 -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: drop the weight argument from netif_napi_add 2022-09-28 18:57:14 -07:00
fjes_regs.h
fjes_trace.c
fjes_trace.h
Makefile