Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp5090778pxb; Tue, 28 Sep 2021 10:19:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHyUqhxDxQzRnm1y/4Z7ly/4zj7BiNGDRn6Kg/bGBTHUj2jauN7okaYBig4FwWklcC3J7l X-Received: by 2002:a63:a80c:: with SMTP id o12mr5587188pgf.422.1632849540565; Tue, 28 Sep 2021 10:19:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632849540; cv=none; d=google.com; s=arc-20160816; b=l/wKAa5tlRdclqxna9sYO/mtGa4WjXnJ9lckq98T+2cNG9p2bFsahKaSgFO2ahUSxa q9RZD7ftn/7US+rV3y8oI3wV52Y3Ygn9dUGjzei5w433Ovrb0DpR9wrBk73OVKQl4UAa u+aDKjVm36IV6a+iOvYm/7tiMD+6nqFnouWdU9Rlr3AoqP3W9UHRXXEFY45YDhRezMZp D8n83dS3AluqXE47j+5q9tXYPw7DKpIq8RElnaf7sXLMT5xIKSdehLF3UYyNXgsCVDKy QY1dMQVQQ64mTUGNi0Vjxd5WBqBWfip7B/U0Q2OwXfm2s+ffNSr2Tj4pP9D7AyLkXkSP 0nzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:references :cc:to:from:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=Qv4CDeHYjjOUMFCGMiQN+LeUoFSnLzhnAn/G99wvURI=; b=VxPEF4d3UZ3pSiWJqwUZHWXMEd92cO9AyM4wJwRMLrlMaKEKO91R7QjKQXBqcMlcBc JXZrs/n9rs5qnYq71uk/j5yzOHCwybMUkWW5TSPGxNutKBUeQWPadG6Nf9qSDNOWfoGf 687ocgVim4vBmzC26pwroBT/Hym2dP1qL+UHDUfZJaH626lcnl3foedIN9wL3rqFYQQ+ TXdgD3+q45RiSBlVLoMbCVmp15NmyXi7tWngqBEPgypSpjH0Jh2Tv5jNpjYNO6aIgt69 N/OX2uEOvop7kUvmVpzXlP8OHchC5yoREVXCK4jdb1Z3YoHyHh8duHA4lDWBL1bDT8Z6 zerQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paragon-software.com header.s=mail header.b=dH3nwHDw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=paragon-software.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oo11si5387311pjb.9.2021.09.28.10.18.41; Tue, 28 Sep 2021 10:19:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@paragon-software.com header.s=mail header.b=dH3nwHDw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=paragon-software.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241986AbhI1RTO (ORCPT + 99 others); Tue, 28 Sep 2021 13:19:14 -0400 Received: from relaydlg-01.paragon-software.com ([81.5.88.159]:51627 "EHLO relaydlg-01.paragon-software.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233219AbhI1RTN (ORCPT ); Tue, 28 Sep 2021 13:19:13 -0400 Received: from dlg2.mail.paragon-software.com (vdlg-exch-02.paragon-software.com [172.30.1.105]) by relaydlg-01.paragon-software.com (Postfix) with ESMTPS id C6EFF81FE6; Tue, 28 Sep 2021 20:17:31 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragon-software.com; s=mail; t=1632849451; bh=Qv4CDeHYjjOUMFCGMiQN+LeUoFSnLzhnAn/G99wvURI=; h=Date:Subject:From:To:CC:References:In-Reply-To; b=dH3nwHDwDKkLkTvb3LixHQgCxrcGSBJolBVu/49HzQwXRb2BOWG2pqJ1Ihlx00Ul5 hydZQtV/wdT6ULBDaOwhtt8mzGNwX1Anmbb9XvrqmEOCa9i2Ua1zaLxqECP1Ko1gU0 Rk8F3Y9QgXGaIvKgghhJSJCE9mqpBorQsitGil/0= Received: from [192.168.211.85] (192.168.211.85) by vdlg-exch-02.paragon-software.com (172.30.1.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Tue, 28 Sep 2021 20:17:31 +0300 Message-ID: <5ee2a090-1709-5ca0-1e78-8db1f3ded973@paragon-software.com> Date: Tue, 28 Sep 2021 20:17:29 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.1 Subject: [PATCH v2 1/3] fs/ntfs3: Fix memory leak if fill_super failed Content-Language: en-US From: Konstantin Komarov To: CC: , , References: In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [192.168.211.85] X-ClientProxiedBy: vdlg-exch-02.paragon-software.com (172.30.1.105) To vdlg-exch-02.paragon-software.com (172.30.1.105) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Restore fc->s_fs_info to free memory allocated in ntfs_init_fs_context. Signed-off-by: Konstantin Komarov --- fs/ntfs3/super.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/ntfs3/super.c b/fs/ntfs3/super.c index 800897777eb0..aff90f70e7bf 100644 --- a/fs/ntfs3/super.c +++ b/fs/ntfs3/super.c @@ -1242,6 +1242,10 @@ static int ntfs_fill_super(struct super_block *sb, struct fs_context *fc) return 0; out: iput(inode); + + /* Restore fc->s_fs_info to free memory allocated in ntfs_init_fs_context. */ + fc->s_fs_info = sbi; + return err; } -- 2.33.0