]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
RDMA/hns: Fix unmatched condition in error path of alloc_user_qp_db()
authorJunxian Huang <huangjunxian6@hisilicon.com>
Tue, 11 Mar 2025 08:48:53 +0000 (16:48 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Apr 2025 12:31:54 +0000 (14:31 +0200)
commitbd3774c05c8f6dd1936b65075edce3e3dde3fe6b
tree9123dc8a5d18256471c8f96f9719ee80246c2b85
parentefe544462fc0b499725364f90bd0f8bbf16f861a
RDMA/hns: Fix unmatched condition in error path of alloc_user_qp_db()

[ Upstream commit b9f59a24ba35a7d955a9f8e148dd9f85b7b40a01 ]

Currently the condition of unmapping sdb in error path is not exactly
the same as the condition of mapping in alloc_user_qp_db(). This may
cause a problem of unmapping an unmapped db in some case, such as
when the QP is XRC TGT. Unified the two conditions.

Fixes: 90ae0b57e4a5 ("RDMA/hns: Combine enable flags of qp")
Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
Link: https://patch.msgid.link/20250311084857.3803665-4-huangjunxian6@hisilicon.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/hw/hns/hns_roce_qp.c