From: Ameer Hamza <amhamza.mgc@gmail.com>
To: tytso@mit.edu, adilger.kernel@dilger.ca
Cc: linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org,
amhamza.mgc@gmail.com
Subject: [PATCH] ext4: handle unsuccessful sbi allocation
Date: Tue, 25 Jan 2022 18:06:04 +0500 [thread overview]
Message-ID: <20220125130604.26473-1-amhamza.mgc@gmail.com> (raw)
Move to common fail path in case of unsuccessful sbi allocation
Addresses-Coverity: 1497833 ("Unused value")
Signed-off-by: Ameer Hamza <amhamza.mgc@gmail.com>
---
fs/ext4/super.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 57914acc5402..0dccf1ed931b 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -5540,8 +5540,10 @@ static int ext4_fill_super(struct super_block *sb, struct fs_context *fc)
int ret;
sbi = ext4_alloc_sbi(sb);
- if (!sbi)
+ if (!sbi) {
ret = -ENOMEM;
+ goto free_sbi;
+ }
fc->s_fs_info = sbi;
--
2.25.1
next reply other threads:[~2022-01-25 13:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-25 13:06 Ameer Hamza [this message]
2022-01-25 13:36 ` Lukas 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=20220125130604.26473-1-amhamza.mgc@gmail.com \
--to=amhamza.mgc@gmail.com \
--cc=adilger.kernel@dilger.ca \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tytso@mit.edu \
/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
Powered by JetHome