From patchwork Tue Mar 11 08:48:55 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junxian Huang X-Patchwork-Id: 14011303 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E671E22B5A8 for ; Tue, 11 Mar 2025 08:56:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.187 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741683397; cv=none; b=l2kCtfCIkh6OsDW0NVkdhWwC15OJ2FRNcNioSnSFu8YfNxbp3TAvLCz9IoCeXHW/cC5U6+Tks21mjn3h78H3HjiCvY0hSxkozfqy6F49hvYCVuZxi5HCEFyY9yryYyk1axJi/oBgxDOxab0tctatF3UpAF+QpH13F53Xu+cUQZw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741683397; c=relaxed/simple; bh=RK9PKMlAmoJCcOamRBfROGxhRSV1dDX73waW/VGZ900=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Ntmpi4AreZ5EsJXb5ApKi5CO1NT+Q7PwZ2cquhmtPqZwjnQs43XIr3fWH8JMhU+R30KrcuKr9aKuKGdUqNoV+RwWBYMqQLgxyUvAG2e7MyEDcKw98dK7OxG1ftZ6/RtPIDyiByjTZDsclrMWN0/croYGVJUS3U64L0sVOyIzKmQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=hisilicon.com; spf=pass smtp.mailfrom=hisilicon.com; arc=none smtp.client-ip=45.249.212.187 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=hisilicon.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=hisilicon.com Received: from mail.maildlp.com (unknown [172.19.163.174]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4ZBnZz4QbnzvWq4; Tue, 11 Mar 2025 16:52:43 +0800 (CST) Received: from kwepemf100018.china.huawei.com (unknown [7.202.181.17]) by mail.maildlp.com (Postfix) with ESMTPS id B2E861402CB; Tue, 11 Mar 2025 16:56:33 +0800 (CST) Received: from localhost.localdomain (10.90.30.45) by kwepemf100018.china.huawei.com (7.202.181.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 11 Mar 2025 16:56:33 +0800 From: Junxian Huang To: , CC: , , , Subject: [PATCH for-rc 5/7] RDMA/hns: Fix a missing rollback in error path of hns_roce_create_qp_common() Date: Tue, 11 Mar 2025 16:48:55 +0800 Message-ID: <20250311084857.3803665-6-huangjunxian6@hisilicon.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20250311084857.3803665-1-huangjunxian6@hisilicon.com> References: <20250311084857.3803665-1-huangjunxian6@hisilicon.com> Precedence: bulk X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemf100018.china.huawei.com (7.202.181.17) When ib_copy_to_udata() fails in hns_roce_create_qp_common(), hns_roce_qp_remove() should be called in the error path to clean up resources in hns_roce_qp_store(). Fixes: 0f00571f9433 ("RDMA/hns: Use new SQ doorbell register for HIP09") Signed-off-by: Junxian Huang --- drivers/infiniband/hw/hns/hns_roce_qp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/hns/hns_roce_qp.c b/drivers/infiniband/hw/hns/hns_roce_qp.c index 18bf3761a64e..2c1c08f37334 100644 --- a/drivers/infiniband/hw/hns/hns_roce_qp.c +++ b/drivers/infiniband/hw/hns/hns_roce_qp.c @@ -1220,7 +1220,7 @@ static int hns_roce_create_qp_common(struct hns_roce_dev *hr_dev, min(udata->outlen, sizeof(resp))); if (ret) { ibdev_err(ibdev, "copy qp resp failed!\n"); - goto err_store; + goto err_flow_ctrl; } }