Skip to content

Commit 951d701

Browse files
Dan CarpenterAndreas Gruenbacher
authored andcommitted
gfs2: Fix a NULL vs IS_ERR() bug in gfs2_find_jhead()
The filemap_grab_folio() function doesn't return NULL, it returns error pointers. Fix the check to match. Fixes: 4082976 ("gfs2: Convert gfs2_find_jhead() to use a folio") Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Andreas Gruenbacher <[email protected]>
1 parent 0776a50 commit 951d701

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/gfs2/lops.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -530,8 +530,8 @@ int gfs2_find_jhead(struct gfs2_jdesc *jd, struct gfs2_log_header_host *head,
530530
if (!folio) {
531531
folio = filemap_grab_folio(mapping,
532532
block >> shift);
533-
if (!folio) {
534-
ret = -ENOMEM;
533+
if (IS_ERR(folio)) {
534+
ret = PTR_ERR(folio);
535535
done = true;
536536
goto out;
537537
}

0 commit comments

Comments
 (0)