1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/net/ethernet/mellanox
Aleksandr Mishin 8ce34dccbe mlxsw: core_linecards: Fix double memory deallocation in case of invalid INI file
In case of invalid INI file mlxsw_linecard_types_init() deallocates memory
but doesn't reset pointer to NULL and returns 0. In case of any error
occurred after mlxsw_linecard_types_init() call, mlxsw_linecards_init()
calls mlxsw_linecard_types_fini() which performs memory deallocation again.

Add pointer reset to NULL.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: b217127e5e ("mlxsw: core_linecards: Add line card objects and implement provisioning")
Signed-off-by: Aleksandr Mishin <amishin@t-argos.ru>
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Michal Kubiak <michal.kubiak@intel.com>
Link: https://patch.msgid.link/20240703203251.8871-1-amishin@t-argos.ru
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-07-04 07:34:42 -07:00
..
mlx4 net: annotate writes on dev->mtu from ndo_change_mtu() 2024-05-07 16:19:14 -07:00
mlx5/core net/mlx5e: Approximate IPsec per-SA payload data bytes count 2024-06-28 12:58:12 +01:00
mlxbf_gige gpio updates for v6.10-rc1 2024-05-14 15:07:07 -07:00
mlxfw mlxfw: Replace zero-length array with DECLARE_FLEX_ARRAY() helper 2023-05-17 21:24:47 -07:00
mlxsw mlxsw: core_linecards: Fix double memory deallocation in case of invalid INI file 2024-07-04 07:34:42 -07:00
Kconfig Add Mellanox BlueField Gigabit Ethernet driver 2021-06-25 11:20:23 -07:00
Makefile Add Mellanox BlueField Gigabit Ethernet driver 2021-06-25 11:20:23 -07:00