]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
qlcnic: fix memory leak in qlcnic_sriov_channel_cfg_cmd()
authorAbdun Nihaal <abdun.nihaal@gmail.com>
Mon, 12 May 2025 04:48:27 +0000 (10:18 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 22 May 2025 12:12:17 +0000 (14:12 +0200)
commit9c2d0899c680ccc91d5e185f410e6ea5fa84d1f3
tree90cb3c52213dd6a98468c13ab014edb432adfd9f
parentb48a47e137cedfd79655accaeeea6b296ad0b9e1
qlcnic: fix memory leak in qlcnic_sriov_channel_cfg_cmd()

[ Upstream commit 9d8a99c5a7c7f4f7eca2c168a4ec254409670035 ]

In one of the error paths in qlcnic_sriov_channel_cfg_cmd(), the memory
allocated in qlcnic_sriov_alloc_bc_mbx_args() for mailbox arguments is
not freed. Fix that by jumping to the error path that frees them, by
calling qlcnic_free_mbx_args(). This was found using static analysis.

Fixes: f197a7aa6288 ("qlcnic: VF-PF communication channel implementation")
Signed-off-by: Abdun Nihaal <abdun.nihaal@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250512044829.36400-1-abdun.nihaal@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c