Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1448740rwb; Fri, 18 Nov 2022 19:30:39 -0800 (PST) X-Google-Smtp-Source: AA0mqf66j6V6/qwzfgG3JLQeWdov+uKJXDC0LZj08tZRnClHzFq0k0R6lR0IicF9A591x+xp6j91 X-Received: by 2002:a17:902:b40b:b0:188:ca57:ce0c with SMTP id x11-20020a170902b40b00b00188ca57ce0cmr2461486plr.57.1668828639192; Fri, 18 Nov 2022 19:30:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668828639; cv=none; d=google.com; s=arc-20160816; b=0FZ2DN65+uGaV51MouHSO8+Rp2VImAcfHhk/bvjdFepn/3OnsK5X2q37OoKjkfuTB/ rfuodM1kFhUWZMLkqDjxWmpe1s/oYJJwCDBb0qFSkX+YtRKnIEOQCrazmX9EgzevVwW7 W8nNcbixgbDIBf36+GqihNqIstRQB/ZXdMpplwrF2pzhLdaxj3evVUuyj6sX/6dIyY17 QHrbu128jc7M6sM4v05fN9ZR74/gK1L/ddlZ/e6itnPorN9rgZW7B8cPY2lvAftLozoh tYrnRw9bcpkVUfF0oSTrcIrNYOOEGZ1DiyBaDEaAyyqFjRHzUw1ch7tuFoPdCqB5pWDz 39XA== 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=uRASbCP/vH0D8RGZoTe8mR/CyOO6MAhLsBB4R+jkhK8=; b=xaelVsc2wzQGMQo6svcD7xtH+htZAN3yUgzq8sPQwiVScXW0PQQHwcsoh/KPOTp+Ps jZTKRrhRt0gg1ZZ5+fCxoyPBD9mPPh87jCFWHG46iBK1aFXAlQIlJCPuvD1RBHZ+E3O+ l9cWRlVCVBWEciVeelA7rvMMSM0zBjYO9O4i37qLjzDeAFhInhAAd8fSEnbIyeLFLz4m h/s55/grphoAS8w8WAIq96jQy+qnLB8ZeUfw5kuVdMEjz5GukjxyFDVPWeGgucjY8nTg +Ppuo+Gu8Xy0pdfyaAazCyjnmvizmP0cqXoj/GkbLcr5u6dZpaDMLj7Q3HHux6GPCOun 57ZQ== 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 s82-20020a632c55000000b00476f67b6558si5450617pgs.40.2022.11.18.19.30.15; Fri, 18 Nov 2022 19:30:39 -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 S229451AbiKSDaI (ORCPT + 99 others); Fri, 18 Nov 2022 22:30:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229592AbiKSDaH (ORCPT ); Fri, 18 Nov 2022 22:30:07 -0500 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D3E4D9E97E for ; Fri, 18 Nov 2022 19:30:05 -0800 (PST) Received: from dggpeml500023.china.huawei.com (unknown [172.30.72.57]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4NDfK962htz15Mcm; Sat, 19 Nov 2022 11:29:33 +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; Sat, 19 Nov 2022 11:29:58 +0800 From: Zhang Xiaoxu To: , , , , , Subject: [PATCH] xprtrdma: Fix regbuf data not freed in rpcrdma_req_create() Date: Sat, 19 Nov 2022 12:34:37 +0800 Message-ID: <20221119043437.1396270-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: dggems705-chm.china.huawei.com (10.3.19.182) 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: 8cec3dba76a4 ("xprtrdma: rpcrdma_regbuf alignment") 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