lkml.org 
[lkml]   [2014]   [May]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] ext2: super: remove unnecessary goto statement
Date
This patch removes unnecessary goto failed,
and moves kfree to failed.

Signed-off-by: Seunghun Lee <waydi1@gmail.com>
---
fs/ext2/super.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/fs/ext2/super.c b/fs/ext2/super.c
index 3750031..7d20a50 100644
--- a/fs/ext2/super.c
+++ b/fs/ext2/super.c
@@ -777,17 +777,15 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
__le32 features;
int err;

- err = -ENOMEM;
sbi = kzalloc(sizeof(*sbi), GFP_KERNEL);
if (!sbi)
- goto failed;
+ return -ENOMEM;

sbi->s_blockgroup_lock =
kzalloc(sizeof(struct blockgroup_lock), GFP_KERNEL);
- if (!sbi->s_blockgroup_lock) {
- kfree(sbi);
+ if (!sbi->s_blockgroup_lock)
goto failed;
- }
+
sb->s_fs_info = sbi;
sbi->s_sb_block = sb_block;

@@ -1138,8 +1136,8 @@ failed_mount:
failed_sbi:
sb->s_fs_info = NULL;
kfree(sbi->s_blockgroup_lock);
- kfree(sbi);
failed:
+ kfree(sbi);
return ret;
}

--
1.7.9.5


\
 
 \ /
  Last update: 2014-05-07 18:21    [W:0.059 / U:0.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site