From: Markus Elfring <Markus.Elfring@web.de>
To: kernel-janitors@vger.kernel.org, Evgeniy Dushistov <dushistov@mail.ru>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] ufs: Delete an unnecessary check before brelse()
Date: Tue, 3 Sep 2019 21:30:31 +0200 [thread overview]
Message-ID: <d57685d8-d0ce-4a53-177f-a98d116d2981@web.de> (raw)
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 3 Sep 2019 21:27:55 +0200
The brelse() function tests whether its argument is NULL
and then returns immediately.
Thus the test around the call is not needed.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
fs/ufs/super.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/ufs/super.c b/fs/ufs/super.c
index 1da0be667409..20799faa307a 100644
--- a/fs/ufs/super.c
+++ b/fs/ufs/super.c
@@ -574,8 +574,7 @@ static int ufs_read_cylinder_structures(struct super_block *sb)
kfree (base);
if (sbi->s_ucg) {
for (i = 0; i < uspi->s_ncg; i++)
- if (sbi->s_ucg[i])
- brelse (sbi->s_ucg[i]);
+ brelse(sbi->s_ucg[i]);
kfree (sbi->s_ucg);
for (i = 0; i < UFS_MAX_GROUP_LOADED; i++)
kfree (sbi->s_ucpi[i]);
--
2.23.0
reply other threads:[~2019-09-03 19:30 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=d57685d8-d0ce-4a53-177f-a98d116d2981@web.de \
--to=markus.elfring@web.de \
--cc=dushistov@mail.ru \
--cc=kernel-janitors@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
all inboxes | Powered by JetHome®