]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
RDMA/hns: Fix xarray race in hns_roce_create_qp_common()
authorJason Gunthorpe <jgg@nvidia.com>
Tue, 28 Apr 2026 16:17:47 +0000 (13:17 -0300)
committerJason Gunthorpe <jgg@nvidia.com>
Sat, 2 May 2026 18:30:48 +0000 (15:30 -0300)
commit7d51783d82fea000a9ce96fa1dcf3e0a8cedc4fb
tree181ad0d04899686d967b0d42520efb81a67fe838
parent48973c6c938737bb900d15dc82b91dfe3586cb0f
RDMA/hns: Fix xarray race in hns_roce_create_qp_common()

Similar to the SRQ case the hr_qp is stored in the xarray before it is
fully initialized. Unlike the SRQ case the error unwinds do not wait for
the completion so keep the refcount 0 until the function succeeds.

Fixes: 9a4435375cd1 ("IB/hns: Add driver files for hns RoCE driver")
Link: https://patch.msgid.link/r/14-v1-41f3135e5565+9d2-rdma_ai_fixes1_jgg@nvidia.com
Suggested-by: Junxian Huang <huangjunxian6@hisilicon.com>
Reviewed-by: Junxian Huang <huangjunxian6@hisilicon.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/hw/hns/hns_roce_qp.c