From: Darrick J. Wong Date: Mon, 31 Jul 2017 20:08:12 +0000 (-0500) Subject: xfs: check _btree_check_block value X-Git-Tag: v4.13.0-rc1~44 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=c3d6d07aacf85649482c1007b9183d69eca8262c;p=thirdparty%2Fxfsprogs-dev.git xfs: check _btree_check_block value Source kernel commit: 1e86eabe73b73c82e1110c746ed3ec6d5e1c0a0d Check the _btree_check_block return value for the firstrec and lastrec functions, since we have the ability to signal that the repositioning did not succeed. Fixes-coverity-id: 114067 Fixes-coverity-id: 114068 Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster Signed-off-by: Eric Sandeen --- diff --git a/libxfs/xfs_btree.c b/libxfs/xfs_btree.c index 1d3924508..0ceba82a8 100644 --- a/libxfs/xfs_btree.c +++ b/libxfs/xfs_btree.c @@ -724,7 +724,8 @@ xfs_btree_firstrec( * Get the block pointer for this level. */ block = xfs_btree_get_block(cur, level, &bp); - xfs_btree_check_block(cur, block, level, bp); + if (xfs_btree_check_block(cur, block, level, bp)) + return 0; /* * It's empty, there is no such record. */ @@ -753,7 +754,8 @@ xfs_btree_lastrec( * Get the block pointer for this level. */ block = xfs_btree_get_block(cur, level, &bp); - xfs_btree_check_block(cur, block, level, bp); + if (xfs_btree_check_block(cur, block, level, bp)) + return 0; /* * It's empty, there is no such record. */