Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2667765rwb; Sat, 19 Nov 2022 22:30:25 -0800 (PST) X-Google-Smtp-Source: AA0mqf7IcX4OWQyyuEjbYW4VZrECmIh5Rpu3nXSVvBx8DFGIXx+ETPTD8/I/6Bhqz/EBIwFB3LuF X-Received: by 2002:a17:90a:3f89:b0:217:90e0:3f8c with SMTP id m9-20020a17090a3f8900b0021790e03f8cmr21046112pjc.192.1668925825557; Sat, 19 Nov 2022 22:30:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668925825; cv=none; d=google.com; s=arc-20160816; b=A5DdnEFVxYvHNWmhwcMEVUZas7btuR6F8wgpvL4dIlGGfur0rqs5gZ2pnA+hSyi/qz MkBUIfgTi2XxzkAIsdTQdyOORJzaCBIi2ySrAFvouzz1c0gVZAtyFr2wQieF7WPXp6Vu tb5Xiuv+UIeAifr9Z3NliJrC/xfYbuRmvjb4X3Nwtrtu0jjCuDsLudRiHhftSNkeeojX f7AgNxHyhq5eT2LwjVZIR5E7zQKdpEBwAF4eFbidviIGDHpOAQRQCP2ZDaHRgg2pTEY4 ca+ZupHOuxOnY6UCv2YJyKuCqqfPLMIab22hxZi+d3vNzk9R6wuKux13ZftYzgKLaGTT fszA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:to:from; bh=36o3YhRuJk99TpFCSRq8Ug39kx17mA+sRvoa/vMQEHM=; b=UHVn80n+qSsC9qgWiOsvKdd8olMTw0vrkkrM8PLvwIzasTLWcCwW+43t4M0ZAXrCbA iQfi6P1ZOHZWKvijiaL8ia9GUoP0aelRZeXRbtboOIaRBNSFVHfSBEa0DNgqRm9ww/sg itLB4GQEMPijLH0Swr0zJgRPuExgF6Fklt6Swf5IlkYVRV5IwD2tIUAWxbBBzXBUTsiy FO6AFccP9epmeE5MRlAT5H7OBZ5odfLeseEdFcq4s+6sWg0oDU6XGf2lPEooh0dUSMUq sXwO+3DcHH9bykK5P3tDhxb+WTik/ZWunzxGAFmK/Qmdot4x/JT9HTT6CFpFighMetJD EtrQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id on1-20020a17090b1d0100b002180eb2c6e3si8138677pjb.139.2022.11.19.22.29.56; Sat, 19 Nov 2022 22:30:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229454AbiKTG3z (ORCPT + 99 others); Sun, 20 Nov 2022 01:29:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229446AbiKTG3y (ORCPT ); Sun, 20 Nov 2022 01:29:54 -0500 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7751BA65BF for ; Sat, 19 Nov 2022 22:29:53 -0800 (PST) Received: from dggpeml500023.china.huawei.com (unknown [172.30.72.57]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4NFLC31qVYzFqLm; Sun, 20 Nov 2022 14:26:39 +0800 (CST) Received: from localhost.localdomain (10.175.101.6) by dggpeml500023.china.huawei.com (7.185.36.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Sun, 20 Nov 2022 14:29:51 +0800 From: Zhang Xiaoxu To: , , , , , Subject: [PATCH v2] xprtrdma: Fix regbuf data not freed in rpcrdma_req_create() Date: Sun, 20 Nov 2022 15:34:29 +0800 Message-ID: <20221120073429.2581160-1-zhangxiaoxu5@huawei.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.101.6] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpeml500023.china.huawei.com (7.185.36.114) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org If rdma receive buffer allocate failed, should call rpcrdma_regbuf_free() to free the send buffer, otherwise, the buffer data will be leaked. Fixes: bb93a1ae2bf4 ("xprtrdma: Allocate req's regbufs at xprt create time") Signed-off-by: Zhang Xiaoxu --- net/sunrpc/xprtrdma/verbs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c index 44b87e4274b4..b098fde373ab 100644 --- a/net/sunrpc/xprtrdma/verbs.c +++ b/net/sunrpc/xprtrdma/verbs.c @@ -831,7 +831,7 @@ struct rpcrdma_req *rpcrdma_req_create(struct rpcrdma_xprt *r_xprt, return req; out3: - kfree(req->rl_sendbuf); + rpcrdma_regbuf_free(req->rl_sendbuf); out2: kfree(req); out1: -- 2.31.1