linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Seunghun Lee <waydi1@gmail.com>
To: jack@suse.cz
Cc: linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org,
	Seunghun Lee <waydi1@gmail.com>
Subject: [PATCH] ext2: super: remove unnecessary goto statement
Date: Thu,  8 May 2014 01:08:03 +0900	[thread overview]
Message-ID: <1399478883-2897-1-git-send-email-waydi1@gmail.com> (raw)

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

             reply	other threads:[~2014-05-07 16:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-07 16:08 Seunghun Lee [this message]
2014-05-12 12:56 ` [PATCH] ext2: super: remove unnecessary goto statement Lukáš Czerner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1399478883-2897-1-git-send-email-waydi1@gmail.com \
    --to=waydi1@gmail.com \
    --cc=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).