linux-stable/drivers/net/ethernet/amd
Yongzhi Liu ba18deddd6 net: pds_core: Fix possible double free in error handling path
When auxiliary_device_add() returns error and then calls
auxiliary_device_uninit(), Callback function pdsc_auxbus_dev_release
calls kfree(padev) to free memory. We shouldn't call kfree(padev)
again in the error handling path.

Fix this by cleaning up the redundant kfree() and putting
the error handling back to where the errors happened.

Fixes: 4569cce43b ("pds_core: add auxiliary_bus devices")
Signed-off-by: Yongzhi Liu <hyperlyzcs@gmail.com>
Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>
Reviewed-by: Shannon Nelson <shannon.nelson@amd.com>
Link: https://lore.kernel.org/r/20240306105714.20597-1-hyperlyzcs@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2024-03-07 12:03:19 +01:00
..
pds_core net: pds_core: Fix possible double free in error handling path 2024-03-07 12:03:19 +01:00
xgbe net: ethtool: pass a pointer to parameters to get/set_rxfh ethtool ops 2023-12-13 22:07:16 -08:00
7990.c
7990.h
a2065.c net: amd: Unified the comparison between pointers and NULL to the same writing 2022-09-16 10:27:47 +01:00
a2065.h
amd8111e.c net: amd: Switch and case should be at the same indent 2022-09-16 10:27:47 +01:00
amd8111e.h net: amd: Correct spelling errors 2022-09-16 10:27:47 +01:00
ariadne.c net: amd: Unified the comparison between pointers and NULL to the same writing 2022-09-16 10:27:47 +01:00
ariadne.h
atarilance.c ethernet: atarilance: mark init function static 2023-08-11 18:24:02 -07:00
au1000_eth.c net: ethernet: amd: Convert to platform remove callback returning void 2023-09-20 09:06:37 +01:00
au1000_eth.h
declance.c
hplance.c
hplance.h
Kconfig pds_core: add AUXILIARY_BUS and NET_DEVLINK to Kconfig 2023-05-03 09:16:53 +01:00
lance.c net: isa: include net/Space.h 2023-05-17 21:27:30 -07:00
Makefile pds_core: Kconfig and pds_core.rst 2023-04-21 08:29:14 +01:00
mvme147.c
nmclan_cs.c net: amd: Fix link leak when verifying config failed 2023-04-25 09:41:18 +01:00
pcnet32.c net: amd: Unified the comparison between pointers and NULL to the same writing 2022-09-16 10:27:47 +01:00
sun3lance.c net: amd: Unified the comparison between pointers and NULL to the same writing 2022-09-16 10:27:47 +01:00
sunlance.c net: ethernet: amd: Convert to platform remove callback returning void 2023-09-20 09:06:37 +01:00