mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
octeontx2-pf: Fix potential memory leak in otx2_init_tc()
[ Upstream commitfbf33f5ac7] In otx2_init_tc(), if rhashtable_init() failed, it does not free tc->tc_entries_bitmap which is allocated in otx2_tc_alloc_ent_bitmap(). Fixes:2e2a8126ff("octeontx2-pf: Unify flow management variables") Signed-off-by: Ziyang Xuan <william.xuanziyang@huawei.com> Reviewed-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
f88acaed07
commit
eefd8953a7
@@ -1090,7 +1090,12 @@ int otx2_init_tc(struct otx2_nic *nic)
|
||||
return err;
|
||||
|
||||
tc->flow_ht_params = tc_flow_ht_params;
|
||||
return rhashtable_init(&tc->flow_table, &tc->flow_ht_params);
|
||||
err = rhashtable_init(&tc->flow_table, &tc->flow_ht_params);
|
||||
if (err) {
|
||||
kfree(tc->tc_entries_bitmap);
|
||||
tc->tc_entries_bitmap = NULL;
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
void otx2_shutdown_tc(struct otx2_nic *nic)
|
||||
|
||||
Reference in New Issue
Block a user