]> git.baikalelectronics.ru Git - kernel.git/commit
ice: switch: fix potential memleak in ice_add_adv_recipe()
authorZhang Changzhong <zhangchangzhong@huawei.com>
Mon, 12 Dec 2022 23:11:26 +0000 (15:11 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Feb 2023 18:11:46 +0000 (19:11 +0100)
commit536482e4f32ecfb99906a553360b1643feeafd52
tree873f3dcda27da026e02263070ac0280731469dd4
parent815e03e6f6053138c480027da35048feef3aa69c
ice: switch: fix potential memleak in ice_add_adv_recipe()

[ Upstream commit e7a1d45d0ca46a9c21291b02f5268b67ae4c5c00 ]

When ice_add_special_words() fails, the 'rm' is not released, which will
lead to a memory leak. Fix this up by going to 'err_unroll' label.

Compile tested only.

Fixes: d8d7095ca94a ("ice: low level support for tunnels")
Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
Tested-by: Sujai Buvaneswaran <sujai.buvaneswaran@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/intel/ice/ice_switch.c