linux/drivers/net/ethernet/chelsio
Abdun Nihaal 00ffb3724c cxgb4: fix memory leak in cxgb4_init_ethtool_filters() error path
In the for loop used to allocate the loc_array and bmap for each port, a
memory leak is possible when the allocation for loc_array succeeds,
but the allocation for bmap fails. This is because when the control flow
goes to the label free_eth_finfo, only the allocations starting from
(i-1)th iteration are freed.

Fix that by freeing the loc_array in the bmap allocation error path.

Fixes: d915c299f1 ("cxgb4: add skeleton for ethtool n-tuple filters")
Signed-off-by: Abdun Nihaal <abdun.nihaal@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://patch.msgid.link/20250414170649.89156-1-abdun.nihaal@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-04-16 17:52:18 -07:00
..
cxgb treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
cxgb3 treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
cxgb4 cxgb4: fix memory leak in cxgb4_init_ethtool_filters() error path 2025-04-16 17:52:18 -07:00
cxgb4vf treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
inline_crypto xfrm: provide common xdo_dev_offload_ok callback implementation 2025-02-21 08:08:15 +01:00
libcxgb net/chelsio/libcxgb: Add __percpu annotations to libcxgb_ppm.c 2024-08-06 19:35:40 -07:00
Kconfig
Makefile