* [PATCH] ubifs: fix an IS_ERR() vs NULL check
@ 2021-06-03 12:34 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2021-06-03 12:34 UTC (permalink / raw)
To: Richard Weinberger
Cc: Artem Bityutskiy, Adrian Hunter, linux-mtd, kernel-janitors
The ubifs_fast_find_frdi_idx() function returns NULL on error, it
doesn't return error pointers. Update the check accordingly.
Fixes: 1e51764a3c2a ("UBIFS: add new flash file system")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
fs/ubifs/gc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/ubifs/gc.c b/fs/ubifs/gc.c
index dc3e26e9ed7b..7cc22d7317ea 100644
--- a/fs/ubifs/gc.c
+++ b/fs/ubifs/gc.c
@@ -895,8 +895,8 @@ int ubifs_gc_start_commit(struct ubifs_info *c)
/* Record index freeable LEBs for unmapping after commit */
while (1) {
lp = ubifs_fast_find_frdi_idx(c);
- if (IS_ERR(lp)) {
- err = PTR_ERR(lp);
+ if (!lp) {
+ err = -ENOMEM;
goto out;
}
if (!lp)
--
2.30.2
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-06-03 12:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-03 12:34 [PATCH] ubifs: fix an IS_ERR() vs NULL check Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox