Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp2422435rdh; Sun, 29 Oct 2023 15:56:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFUaSASPXYRtcDD4BG0ldhbjZ7/jbIjHYwPySTajs8PTAXpUlKvDoVzxxo6SCwr2dJ0Nvbq X-Received: by 2002:a05:6870:d692:b0:1ea:6a81:8c8a with SMTP id z18-20020a056870d69200b001ea6a818c8amr11528988oap.29.1698620203062; Sun, 29 Oct 2023 15:56:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698620203; cv=none; d=google.com; s=arc-20160816; b=qqxyqcWVl1fTZ65CLEJU4B30IefvoOjDq7mDQK3pSZHFkFH/aHuuWJcoGPEelWUlP4 FY61qOiHH+27JQTenOaJOEUIC7Qo2ZzA36+dSbCYNBUJ/31XzjRva9YLGADk9PpBxYTL 3yd5l/FL5VL1I7DqNhQ+0SvkmWqbQev/nJV9Yib5vc6f9w1DI+3Waq1SzmPVEGiEpI3f L5PmYzADk35lhI72+wZNONNEZp1MdNj86IU4s20D6Lr0sBNzt5iXZLDjAvUXzYIN9Po2 iEVLs5TCaNYIOKArB95HpeOy0uZkAgmMNzjnye3c5lVPz49FeAsa+HmKsHrBuMBm2sBM urRA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=r1XQLnK7i37dOUzb6VImqxiwl8oxKaElwma0aUUho4o=; fh=p54PNvJmTmX2w/220wbw6SFfcFhPG2UKEnRCdOeZ+6s=; b=jPU+5q7X3gkD0jo3QH5TGT0l9fJEDborlE4A1YOFW/dpnOZ1FaOvg59/s1dZExLjd8 xXJXWVe88IyV36RfgZQ/M5ZSRrNr61Wbz7nLEHNC0szxukAWX5B9r7mcwxr3pPmlD0h6 XCfsqjZw83AlCfckp48f2I2SX04YgNNBWw0+bpOLbp58C7yfRRNUBrNFO8XWWbhsXAvw i+Qpac5nAN8gStAcrKIg18gq4q3AnY5mAkJqCZUMUYWcFTzAiF1YuZK9aj8bV5fTkl8/ u6DBFVHpLePJe9cOmHyiZPlHCpQ99N2Bk1GReFiNepdPjWDOXWegCun1SBaWFDeyUr6G C2XQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ojQmZhvx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id 14-20020a63184e000000b00577f87e6210si4213643pgy.332.2023.10.29.15.56.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Oct 2023 15:56:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ojQmZhvx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id C116C8089872; Sun, 29 Oct 2023 15:56:06 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231429AbjJ2Wze (ORCPT + 99 others); Sun, 29 Oct 2023 18:55:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230519AbjJ2WzO (ORCPT ); Sun, 29 Oct 2023 18:55:14 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C18921B6; Sun, 29 Oct 2023 15:55:04 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AB43DC433CD; Sun, 29 Oct 2023 22:55:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698620104; bh=pyCdkn/dJ0qS0Zv0n21ByAtdrhLUzh1LXYsv29Xd2Rw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ojQmZhvxY5GoHEahZ34IXRvBTyD6kN/IEQ27ZXLp5ZO5xWfhXRm3uEWZQ6SfUTtMC GapwPHnwRpUYbnXiRuDNldPFxct9PUssQdbMuAXwNia96bdoSBLm1RCgpFBG3/mAmM SekL3t6Gm1H5VJNdqn8h8gQQVw/Zi/mwvcy0U5DaR6X0jZ9VQ+d1z4xc7DpyE4PTqG d+ecExMyrJXfiU4JggS55mcU/yngYZJ8P0gMqwvkJPyrzmOAUo3KphUuV9Jukwg3Wq 8Xa8CHBufSd0DqJIVndJ1W+daG6CC8yVzqgW9yU5x6dLEhj/IZlNXx5mXUcCoVF4vT 16yeB9lrddYRA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Su Hui , Konstantin Komarov , Sasha Levin , ntfs3@lists.linux.dev Subject: [PATCH AUTOSEL 6.5 15/52] fs/ntfs3: Avoid possible memory leak Date: Sun, 29 Oct 2023 18:53:02 -0400 Message-ID: <20231029225441.789781-15-sashal@kernel.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231029225441.789781-1-sashal@kernel.org> References: <20231029225441.789781-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.5.9 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Sun, 29 Oct 2023 15:56:07 -0700 (PDT) From: Su Hui [ Upstream commit e4494770a5cad3c9d1d2a65ed15d07656c0d9b82 ] smatch warn: fs/ntfs3/fslog.c:2172 last_log_lsn() warn: possible memory leak of 'page_bufs' Jump to label 'out' to free 'page_bufs' and is more consistent with other code. Signed-off-by: Su Hui Signed-off-by: Konstantin Komarov Signed-off-by: Sasha Levin --- fs/ntfs3/fslog.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/ntfs3/fslog.c b/fs/ntfs3/fslog.c index 12f28cdf5c838..98ccb66508583 100644 --- a/fs/ntfs3/fslog.c +++ b/fs/ntfs3/fslog.c @@ -2168,8 +2168,10 @@ static int last_log_lsn(struct ntfs_log *log) if (!page) { page = kmalloc(log->page_size, GFP_NOFS); - if (!page) - return -ENOMEM; + if (!page) { + err = -ENOMEM; + goto out; + } } /* -- 2.42.0