Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d4f97441 authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman
Browse files

GFS2: Fix reference to ERR_PTR in gfs2_glock_iter_next




[ Upstream commit 14d37564fa3dc4e5d4c6828afcd26ac14e6796c5 ]

This patch fixes a place where function gfs2_glock_iter_next can
reference an invalid error pointer.

Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 11bf4a8e
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -1798,16 +1798,18 @@ void gfs2_glock_exit(void)

static void gfs2_glock_iter_next(struct gfs2_glock_iter *gi)
{
	do {
		gi->gl = rhashtable_walk_next(&gi->hti);
	while ((gi->gl = rhashtable_walk_next(&gi->hti))) {
		if (IS_ERR(gi->gl)) {
			if (PTR_ERR(gi->gl) == -EAGAIN)
				continue;
			gi->gl = NULL;
			return;
		}
		/* Skip entries for other sb and dead entries */
	} while ((gi->gl) && ((gi->sdp != gi->gl->gl_name.ln_sbd) ||
			      __lockref_is_dead(&gi->gl->gl_lockref)));
		if (gi->sdp == gi->gl->gl_name.ln_sbd &&
		    !__lockref_is_dead(&gi->gl->gl_lockref))
			return;
	}
}

static void *gfs2_glock_seq_start(struct seq_file *seq, loff_t *pos)