octeontx2-pf: Fix potential memory leak in otx2_init_tc()
authorZiyang Xuan <william.xuanziyang@huawei.com>
Fri, 2 Dec 2022 11:04:30 +0000 (19:04 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Dec 2022 10:37:26 +0000 (11:37 +0100)
commiteefd8953a74822cb72006632b9ee9dd95f92c146
tree0b948b368e5444acb6d58dbdb4f0b33666b913f3
parentf88acaed07b1794eee9a88f00bd959d72fcfca44
octeontx2-pf: Fix potential memory leak in otx2_init_tc()

[ Upstream commit fbf33f5ac76f2cdb47ad9763f620026d5cfa57ce ]

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: 2e2a8126ffac ("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>
drivers/net/ethernet/marvell/octeontx2/nic/otx2_tc.c