Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1977133rwb; Thu, 8 Dec 2022 18:21:49 -0800 (PST) X-Google-Smtp-Source: AA0mqf7ZRYODlyBSmxt5p80QiiB53MQ02gbj/LwClqN9XhuFqa++vxIpdPNkohYrhKGbLrtGyXIH X-Received: by 2002:a17:902:7e88:b0:189:ced9:c9e5 with SMTP id z8-20020a1709027e8800b00189ced9c9e5mr3831242pla.13.1670552509386; Thu, 08 Dec 2022 18:21:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670552509; cv=none; d=google.com; s=arc-20160816; b=j9UMKplPdRMnXit+X0dXcCfvpWzET3E9gxMWSZQorMjaY6IiVgpHwPBOjAzNbne0Q/ bupCkzjjse7ljsWc7BFc1XB1deaeQrFuS+2eKyaDoieaHXC4sMgBdRu/2QsRsUDLBJwI mkkwus7ccarCKxX7uXoI9V08AaQOj45DWehmmrXCD1SLDPBYATuMLgH9ViNPDlwde3rD 2Kg8ezXV5Ni6C4ERyvI2ExtysPXe2gnOJr84HDEVTF3EuI/5dGMV1Pz2mMs+hP26VnUS zWG51TM+UJIrWbErnOy/1c++bC5aV/MhkcupA/gsegXp0DiqsA1UAD48FhF2kW5lo9mQ qwUQ== 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:cc:to:from; bh=jaTz3Jmomo8Gh7QoaDVJSklaszveAyz7HQ/LHCrG8pM=; b=JGlTDJz9RNLaQURCQee9+ZZ76kqs+8gvxbC+Bdx+p1fCnHC+PmPuamKTNRmM6NDToW 7BndlAHTJyyajKzPAwu04eiL0u/qwWT0pODg2UYXuYRYhP7uQ3U6V/OD9dcm53x0LLCV MynTjFJG9k3aN3OkbOVgju/4T6SZU+bEUwZJEjpmUNW15Jtq0gTHqh7M0Nd8EJsC6glc +vdrqs7Dl8pyzO6SlTZxNi5N/EaCUYJv7BRMlkqdFgZTVZHzZAQpAtcJF7oFSrBC2zj7 XZu1EfTzR3xNMViTuWuQCKwzG6we4pKHPA+5ALOg3EH5PdvN5V7zre6yKF+zwrKpoaRm +2Dw== 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 k5-20020a170902c40500b00178386d88c6si411149plk.186.2022.12.08.18.21.28; Thu, 08 Dec 2022 18:21:49 -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 S229556AbiLICSb (ORCPT + 99 others); Thu, 8 Dec 2022 21:18:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229521AbiLICSa (ORCPT ); Thu, 8 Dec 2022 21:18:30 -0500 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA2C2284; Thu, 8 Dec 2022 18:18:29 -0800 (PST) Received: from lhrpeml500004.china.huawei.com (unknown [172.18.147.201]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4NSvjv3HnJz6HJG9; Fri, 9 Dec 2022 10:14:59 +0800 (CST) Received: from mscphis00759.huawei.com (10.123.66.134) by lhrpeml500004.china.huawei.com (7.191.163.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Fri, 9 Dec 2022 02:18:26 +0000 From: Konstantin Meskhidze To: CC: , , , , , Subject: [PATCH] fs: NFSv4.1: Fix memory leakage Date: Fri, 9 Dec 2022 10:18:23 +0800 Message-ID: <20221209021823.1232874-1-konstantin.meskhidze@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.123.66.134] X-ClientProxiedBy: mscpeml100002.china.huawei.com (7.188.26.75) To lhrpeml500004.china.huawei.com (7.191.163.9) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,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 This commit fixes potential memory leakage of 'calldata' memory chunk in _nfs41_proc_sequence() function. Signed-off-by: Konstantin Meskhidze --- fs/nfs/nfs4proc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 86ed5c0142c3..b7aa66167341 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -9416,8 +9416,10 @@ static struct rpc_task *_nfs41_proc_sequence(struct nfs_client *clp, task_setup_data.callback_data = calldata; ret = rpc_run_task(&task_setup_data); - if (IS_ERR(ret)) + if (IS_ERR(ret)) { + kfree(calldata); goto out_err; + } return ret; out_put_clp: nfs_put_client(clp); -- 2.25.1