public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Richard Weinberger <richard@nod.at>
Cc: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>,
	Adrian Hunter <ext-adrian.hunter@nokia.com>,
	linux-mtd@lists.infradead.org, kernel-janitors@vger.kernel.org
Subject: [PATCH] ubifs: fix an IS_ERR() vs NULL check
Date: Thu, 3 Jun 2021 15:34:43 +0300	[thread overview]
Message-ID: <YLjMYy9E6U2/flhP@mwanda> (raw)

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/

                 reply	other threads:[~2021-06-03 12:36 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=YLjMYy9E6U2/flhP@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=Artem.Bityutskiy@nokia.com \
    --cc=ext-adrian.hunter@nokia.com \
    --cc=kernel-janitors@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