kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Colin King <colin.king@canonical.com>
To: Richard Weinberger <richard@nod.at>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	linux-mtd@lists.infradead.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] ubifs: Remove a redundant null check on pointer lp
Date: Mon, 21 Jun 2021 16:22:49 +0100	[thread overview]
Message-ID: <20210621152249.20901-1-colin.king@canonical.com> (raw)

From: Colin Ian King <colin.king@canonical.com>

An earlier fix to replace an IS_ERR check on lp with a null check
on lp didn't remove a following null check on lp. The second null
check is redundant and can be removed.

Addresses-Coverity: ("Logically dead code")
Fixes: c770cd5190ba ("ubifs: fix an IS_ERR() vs NULL check")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 fs/ubifs/gc.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/fs/ubifs/gc.c b/fs/ubifs/gc.c
index 7cc22d7317ea..465beea52176 100644
--- a/fs/ubifs/gc.c
+++ b/fs/ubifs/gc.c
@@ -899,8 +899,6 @@ int ubifs_gc_start_commit(struct ubifs_info *c)
 			err = -ENOMEM;
 			goto out;
 		}
-		if (!lp)
-			break;
 		idx_gc = kmalloc(sizeof(struct ubifs_gced_idx_leb), GFP_NOFS);
 		if (!idx_gc) {
 			err = -ENOMEM;
-- 
2.31.1


             reply	other threads:[~2021-06-21 15:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-21 15:22 Colin King [this message]
2021-06-22  2:38 ` [PATCH] ubifs: Remove a redundant null check on pointer lp Zhihao Cheng
2021-06-22  6:44   ` Dan Carpenter
2021-06-22  7:26     ` Richard Weinberger
2021-06-22  7:24   ` Richard Weinberger

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=20210621152249.20901-1-colin.king@canonical.com \
    --to=colin.king@canonical.com \
    --cc=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=richard@nod.at \
    /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).