From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6751AFC6194 for ; Fri, 8 Nov 2019 11:41:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 328E62245A for ; Fri, 8 Nov 2019 11:41:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573213282; bh=TGsOxMyPWE5J2waCsiFoRzIAdziPYQCI2nChIIFrhiw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=jNF7XCr1vC57E5MXheQ6Ypg8AQbvftJ9LU3cQCFaBlUUI59EGb4bArQgPRoNtCfzO 72qN42kCb7/e7fFepWvGpkGXalEXejG8TgrS4DQ+M4j435THO9ATNTTX/Znv59i3Dh WhF/StEEhcyaOJe5C+4TasRLg/lMr0lEGsHb60J4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389374AbfKHLlV (ORCPT ); Fri, 8 Nov 2019 06:41:21 -0500 Received: from mail.kernel.org ([198.145.29.99]:54426 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389227AbfKHLlM (ORCPT ); Fri, 8 Nov 2019 06:41:12 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CE7DC222CF; Fri, 8 Nov 2019 11:41:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573213272; bh=TGsOxMyPWE5J2waCsiFoRzIAdziPYQCI2nChIIFrhiw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JrtBQM2c34qggKGChPE09KAPlyE69PwESatb6I/mxLQsKNEb0v2VgiftSC54qzkdY 3LHP4bQ/px8IECgaHJkZRC2xQwZ5XSUUWWXpUZdNxj5gHZUkaDgETuOiwqH5Wfv3on FxkK8QoE92SIMGlg8sI+9YjqC7ttnsMA/7bdw1Yc= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Chao Yu , Jaegeuk Kim , Sasha Levin , linux-f2fs-devel@lists.sourceforge.net Subject: [PATCH AUTOSEL 4.19 134/205] f2fs: fix memory leak of write_io in fill_super() Date: Fri, 8 Nov 2019 06:36:41 -0500 Message-Id: <20191108113752.12502-134-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191108113752.12502-1-sashal@kernel.org> References: <20191108113752.12502-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chao Yu [ Upstream commit 0b2103e886e6de9802e1170e57c573443286a483 ] It needs to release memory allocated for sbi->write_io in error path, otherwise, it will cause memory leak. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim Signed-off-by: Sasha Levin --- fs/f2fs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 6851afc3bf805..588c575bd72b0 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -2923,7 +2923,7 @@ try_onemore: GFP_KERNEL); if (!sbi->write_io[i]) { err = -ENOMEM; - goto free_options; + goto free_bio_info; } for (j = HOT; j < n; j++) { -- 2.20.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 38FA1C5DF60 for ; Fri, 8 Nov 2019 11:41:22 +0000 (UTC) Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 08F30222D1; Fri, 8 Nov 2019 11:41:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sourceforge.net header.i=@sourceforge.net header.b="CHqWW6pG"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sf.net header.i=@sf.net header.b="WElupGz6"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="JrtBQM2c" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 08F30222D1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-f2fs-devel-bounces@lists.sourceforge.net Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1iT2dl-00062q-O6; Fri, 08 Nov 2019 11:41:21 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1iT2dk-00062a-2F for linux-f2fs-devel@lists.sourceforge.net; Fri, 08 Nov 2019 11:41:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=0xQ9MPOM3TbT2lYbtZ9G5YVrCFjLuijrEMWDbRTwUj8=; b=CHqWW6pGhdbnJ0KqYuyuiDkmj3 zlCghn986E5RxlVVeTyp2anK4n6pFNvwQZTt2UrNMizKhk2JyxSHj4/yp6S7qXjNzhSGecpFF19/k KMcHSe3IMqfKbe/FiYTHN8SPvX0U5K9/atTfvRYG8rjTrvHIZ9NZOkjDRI5HqYGYWhEk=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=0xQ9MPOM3TbT2lYbtZ9G5YVrCFjLuijrEMWDbRTwUj8=; b=WElupGz6KcObjXPCI1Y0su3KnA Wdw1zfG5E+wTEDd9TkRers/ARWXdGDVk5+xRx3WlEdWiTX/KeYIA1XRhf1zSe69iM6y9T4HkzNsk+ op/HARb7w8TlDT1Iaf4xmnH/JTwEkNQnqSRFYC5kuikz960opAwznu6R3U6r8FIf6Ll0=; Received: from mail.kernel.org ([198.145.29.99]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1iT2di-006ULv-3h for linux-f2fs-devel@lists.sourceforge.net; Fri, 08 Nov 2019 11:41:20 +0000 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CE7DC222CF; Fri, 8 Nov 2019 11:41:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573213272; bh=TGsOxMyPWE5J2waCsiFoRzIAdziPYQCI2nChIIFrhiw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JrtBQM2c34qggKGChPE09KAPlyE69PwESatb6I/mxLQsKNEb0v2VgiftSC54qzkdY 3LHP4bQ/px8IECgaHJkZRC2xQwZ5XSUUWWXpUZdNxj5gHZUkaDgETuOiwqH5Wfv3on FxkK8QoE92SIMGlg8sI+9YjqC7ttnsMA/7bdw1Yc= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Date: Fri, 8 Nov 2019 06:36:41 -0500 Message-Id: <20191108113752.12502-134-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191108113752.12502-1-sashal@kernel.org> References: <20191108113752.12502-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-Headers-End: 1iT2di-006ULv-3h Subject: [f2fs-dev] [PATCH AUTOSEL 4.19 134/205] f2fs: fix memory leak of write_io in fill_super() X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sasha Levin , Jaegeuk Kim , linux-f2fs-devel@lists.sourceforge.net Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net From: Chao Yu [ Upstream commit 0b2103e886e6de9802e1170e57c573443286a483 ] It needs to release memory allocated for sbi->write_io in error path, otherwise, it will cause memory leak. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim Signed-off-by: Sasha Levin --- fs/f2fs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 6851afc3bf805..588c575bd72b0 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -2923,7 +2923,7 @@ try_onemore: GFP_KERNEL); if (!sbi->write_io[i]) { err = -ENOMEM; - goto free_options; + goto free_bio_info; } for (j = HOT; j < n; j++) { -- 2.20.1 _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel