From patchwork Tue Dec 20 03:12:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: shaozhengchao X-Patchwork-Id: 13077455 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44A9FC001B2 for ; Tue, 20 Dec 2022 03:04:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232546AbiLTDEP (ORCPT ); Mon, 19 Dec 2022 22:04:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229746AbiLTDEO (ORCPT ); Mon, 19 Dec 2022 22:04:14 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82AD613D1E for ; Mon, 19 Dec 2022 19:04:13 -0800 (PST) Received: from dggpeml500026.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4NbhGG3WNGzRq32; Tue, 20 Dec 2022 11:03:02 +0800 (CST) Received: from huawei.com (10.175.101.6) by dggpeml500026.china.huawei.com (7.185.36.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 20 Dec 2022 11:04:11 +0800 From: Zhengchao Shao To: , , , , , , , , CC: , , , , Subject: [PATCH] 9p/rdma: unmap receive dma buffer in rdma_request() Date: Tue, 20 Dec 2022 11:12:23 +0800 Message-ID: <20221220031223.3890143-1-shaozhengchao@huawei.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Originating-IP: [10.175.101.6] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpeml500026.china.huawei.com (7.185.36.106) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org When down_interruptible() failed in rdma_request(), receive dma buffer is not unmapped. Add unmap action to error path. Fixes: fc79d4b104f0 ("9p: rdma: RDMA Transport Support for 9P") Signed-off-by: Zhengchao Shao --- net/9p/trans_rdma.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/9p/trans_rdma.c b/net/9p/trans_rdma.c index 83f9100d46bf..da83023fecbf 100644 --- a/net/9p/trans_rdma.c +++ b/net/9p/trans_rdma.c @@ -499,6 +499,8 @@ static int rdma_request(struct p9_client *client, struct p9_req_t *req) if (down_interruptible(&rdma->sq_sem)) { err = -EINTR; + ib_dma_unmap_single(rdma->cm_id->device, c->busa, + c->req->tc.size, DMA_TO_DEVICE); goto send_error; }