From a605e86912ba6fc4b79084c286b1b45e753b72cc Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Mon, 6 Nov 2017 12:09:29 -0800 Subject: [PATCH] xfs: fix btree scrub deref check The btree scrubber has some custom code to retrieve and check a btree block via xfs_btree_lookup_get_block. This function will either return an error code (verifiers failed) or a *pblock will be untouched (bad pointer). Since we previously set *pblock to NULL, we need to check *pblock, not pblock, to trigger the early bailout. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner --- fs/xfs/scrub/btree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/xfs/scrub/btree.c b/fs/xfs/scrub/btree.c index a81440496e7b..df0766132ace 100644 --- a/fs/xfs/scrub/btree.c +++ b/fs/xfs/scrub/btree.c @@ -335,7 +335,7 @@ xfs_scrub_btree_get_block( error = xfs_btree_lookup_get_block(bs->cur, level, pp, pblock); if (!xfs_scrub_btree_process_error(bs->sc, bs->cur, level, &error) || - !pblock) + !*pblock) return error; xfs_btree_get_block(bs->cur, level, pbp);