summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Efremov <efremov@linux.com>2020-06-10 01:14:46 +0300
committerJaegeuk Kim <jaegeuk@kernel.org>2020-06-18 12:33:18 -0700
commit742532d11d8328231d099f557e6287e75b2d247b (patch)
tree4697e754226fde2ee76f6fa3f8756d833845b494
parent99bbe307013059951368d12f5454d34568de4850 (diff)
f2fs: use kfree() instead of kvfree() to free superblock data
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, raw_super in f2fs_fill_super() and f2fs_put_super() because the memory is allocated with kzalloc(). Signed-off-by: Denis Efremov <efremov@linux.com> Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r--fs/f2fs/super.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 20e56b0fa46a..426cebdd84e5 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -1243,7 +1243,7 @@ static void f2fs_put_super(struct super_block *sb)
sb->s_fs_info = NULL;
if (sbi->s_chksum_driver)
crypto_free_shash(sbi->s_chksum_driver);
- kvfree(sbi->raw_super);
+ kfree(sbi->raw_super);
destroy_device_list(sbi);
f2fs_destroy_xattr_caches(sbi);
@@ -1259,7 +1259,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)
@@ -3137,7 +3137,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;
@@ -3816,11 +3816,11 @@ free_options:
fscrypt_free_dummy_context(&F2FS_OPTION(sbi).dummy_enc_ctx);
kvfree(options);
free_sb_buf:
- kvfree(raw_super);
+ kfree(raw_super);
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) {