]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
RDMA/bnxt_re: Fix a potential memory leak in destroy_gsi_sqp
authorYanLong Dai <daiyanlong@kylinos.cn>
Wed, 24 Sep 2025 06:14:44 +0000 (14:14 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Nov 2025 20:37:35 +0000 (15:37 -0500)
commit3bf2fbd8698993ca4852c063180667eef605a2cd
tree889723da76d6ee66f525c81fbe7b75bd1e0045fa
parent24e4530fd6b5e1dd88107ecb852c750decf7de62
RDMA/bnxt_re: Fix a potential memory leak in destroy_gsi_sqp

[ Upstream commit 88de89f184661ebb946804a5abdf2bdec7f0a7ab ]

The current error handling path in bnxt_re_destroy_gsi_sqp() could lead
to a resource leak. When bnxt_qplib_destroy_qp() fails, the function
jumps to the 'fail' label and returns immediately, skipping the call
to bnxt_qplib_free_qp_res().

Continue the resource teardown even if bnxt_qplib_destroy_qp() fails,
which aligns with the driver's general error handling strategy and
prevents the potential leak.

Fixes: 8dae419f9ec73 ("RDMA/bnxt_re: Refactor queue pair creation code")
Signed-off-by: YanLong Dai <daiyanlong@kylinos.cn>
Link: https://patch.msgid.link/20250924061444.11288-1-daiyanlong@kylinos.cn
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/hw/bnxt_re/ib_verbs.c