Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp4475325ybg; Mon, 8 Jun 2020 08:44:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxE4REUksughkhsSDm3AJOB4X30OhwMdYaB0fukVGhz4PEjcCCuuLNOEXwumqv6tJHjXAlA X-Received: by 2002:a50:fd05:: with SMTP id i5mr22245882eds.79.1591631047261; Mon, 08 Jun 2020 08:44:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591631047; cv=none; d=google.com; s=arc-20160816; b=iz1JcmAVD8pMj4C1xR3WLGPmj+Uwky0hsfxsqWikxFnvJaJ8XiCgo2ziCiaxVEjuIC ga4eVxzteK193J32OgYse1UvCqdfgvLPY29DGinkyNSuZ1ZMbxVVAg6uwafL9RhKQzrd BbLfRN+Qo9SAkx5Nbhjtqr74OMjLVdp+AzM6pGFLYqEnApIL/tQ1/wm3YzGVUp/pR4cz zoaCnazQiY+zar0Yc9r50ZY4vODCLJH9jaS7lAEEyIqEeDM0rvSy27NWP3+e1tgLwkVY 8Gf7ffKsqybqPkmBX0j4YNIyZwaBKsI5R6kEeti1bY/32tR5DSSsbiGdFkDKv5ctbXgY K7aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=cHWA4ojiiDEn5KL63INPPyDAtucasDF2S7FDQVE+qDM=; b=VDrg7DqVaH+sGXAgINrjrQ9tifQVZ2VPlioc3qwTxBM48otLG2V0sarwqmF7HPBdGN T+ylHzon4kcYfJgukHXICoLOhsYvRaE4RFGSYIo2hkWHMtm3FQwBsTHQiSV/1VL/PjUF /oaVLMrXmTCTL5gSYCoPUeTOzru6BcC8St9pDZKDsvuw0Io5SSEFxpMnIIkfR9LPV8zC hMTBfjH9mLSoOt76q5XpV7QYSfF1pHGynWfHLnRJrSRnoNpM/t+Us60lC7XfZM3CRSj7 TXEkn2QYIYqjnmKs9Ygn5qi8tShqE4u3c7gDK34hu51IcaTl9em5GORiSAYMZ/UJ2vCC xoPQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id si8si8789549ejb.7.2020.06.08.08.43.44; Mon, 08 Jun 2020 08:44:07 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730337AbgFHPlj (ORCPT + 99 others); Mon, 8 Jun 2020 11:41:39 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:39529 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729580AbgFHPli (ORCPT ); Mon, 8 Jun 2020 11:41:38 -0400 Received: by mail-lj1-f196.google.com with SMTP id a9so17521906ljn.6 for ; Mon, 08 Jun 2020 08:41:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cHWA4ojiiDEn5KL63INPPyDAtucasDF2S7FDQVE+qDM=; b=hzcCh22/oIZH2lPoXwU/Bq7Tliy//QWFMNfLrZy/9WCnFLO/n+ZIh0laLe1/mLmOT/ yqRZA9YKt7QGSRVsIbV1y6m3dZccqjXZTlozabQbty1EUkH+bBggP7E08biyPR6k5MLm doUKeS1CfZojxX79+ya5KP0XIgL89GpAf4DNWD3Xj/gXbFMhNqElPZ6uTLtnShPXOB2N 6qDuan6FayV5Zd2m7c3Dahu36v4/atSIN8C4Bp1TqB/101xgFWETvKa3UhNhCprPhj7Z BZVM1oey22phi1VlYh9OfXCAO118n8oNbycjkC8k4deHD2KGRxHvRKmH8nG9sC6z9aku CocA== X-Gm-Message-State: AOAM533yuDToNKwan+Nnu5wgRRjB8U6uJJps2VfTlcoQt1KAdcvL+K39 /B6GNc5zW8zIN4JuAmGDy2I= X-Received: by 2002:a2e:6c07:: with SMTP id h7mr12138763ljc.125.1591630895189; Mon, 08 Jun 2020 08:41:35 -0700 (PDT) Received: from localhost.localdomain ([213.87.137.116]) by smtp.googlemail.com with ESMTPSA id m3sm2497480ljb.38.2020.06.08.08.41.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jun 2020 08:41:34 -0700 (PDT) From: Denis Efremov To: Chao Yu , Jaegeuk Kim Cc: Denis Efremov , linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: [PATCH v2] f2fs: use kfree() instead of kvfree() to free superblock data Date: Mon, 8 Jun 2020 18:41:23 +0300 Message-Id: <20200608154123.235198-1-efremov@linux.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200605181533.73113-1-efremov@linux.com> References: <20200605181533.73113-1-efremov@linux.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use kfree() instead of kvfree() to free super in read_raw_super_block() because the memory is allocated with kzalloc() in the function. Use kfree() instead of kvfree() to free sbi in f2fs_fill_super() and f2fs_put_super() because the memory is allocated with kzalloc(). Fixes: 5222595d093e ("f2fs: use kvmalloc, if kmalloc is failed") Signed-off-by: Denis Efremov --- Changes in v2: - Single patch instead of two separate patches - kvfree fixed in f2fs_put_super fs/f2fs/super.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 8a9955902d84..94bfc140bef9 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -1257,7 +1257,7 @@ static void f2fs_put_super(struct super_block *sb) #ifdef CONFIG_UNICODE utf8_unload(sbi->s_encoding); #endif - kvfree(sbi); + kfree(sbi); } int f2fs_sync_fs(struct super_block *sb, int sync) @@ -3130,7 +3130,7 @@ static int read_raw_super_block(struct f2fs_sb_info *sbi, /* No valid superblock */ if (!*raw_super) - kvfree(super); + kfree(super); else err = 0; @@ -3812,7 +3812,7 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent) free_sbi: if (sbi->s_chksum_driver) crypto_free_shash(sbi->s_chksum_driver); - kvfree(sbi); + kfree(sbi); /* give only one another chance */ if (retry_cnt > 0 && skip_recovery) { -- 2.26.2