kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ubifs: Remove a redundant null check on pointer lp
@ 2021-06-21 15:22 Colin King
  2021-06-22  2:38 ` Zhihao Cheng
  0 siblings, 1 reply; 5+ messages in thread
From: Colin King @ 2021-06-21 15:22 UTC (permalink / raw)
  To: Richard Weinberger, Dan Carpenter, linux-mtd
  Cc: kernel-janitors, linux-kernel

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-06-22  7:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-21 15:22 [PATCH] ubifs: Remove a redundant null check on pointer lp Colin King
2021-06-22  2:38 ` Zhihao Cheng
2021-06-22  6:44   ` Dan Carpenter
2021-06-22  7:26     ` Richard Weinberger
2021-06-22  7:24   ` Richard Weinberger

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).