From: Gao Xiang Date: Fri, 23 Apr 2021 14:20:15 +0000 (-0400) Subject: repair: fix an uninitialized variable issue X-Git-Tag: v5.12.0-rc1~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=da7f6039b6f0fed8cb8fce6bd3c876a02bcca9f9;p=thirdparty%2Fxfsprogs-dev.git repair: fix an uninitialized variable issue An uninitialized variable issue reported by Coverity, it seems the following for-loop can be exited in advance with isblock == 1, and bp is still uninitialized. In case of that, initialize bp as NULL in advance to avoid this. Fixes: 1f7c7553489c ("repair: don't duplicate names in phase 6") Fixes-coverity-id: 1476291 Signed-off-by: Gao Xiang Reviewed-by: Darrick J. Wong Signed-off-by: Eric Sandeen --- diff --git a/repair/phase6.c b/repair/phase6.c index 72287b5c6..6bddfefa3 100644 --- a/repair/phase6.c +++ b/repair/phase6.c @@ -2195,7 +2195,7 @@ longform_dir2_entry_check( int ino_offset, struct dir_hash_tab *hashtab) { - struct xfs_buf *bp; + struct xfs_buf *bp = NULL; xfs_dablk_t da_bno; freetab_t *freetab; int i;