From: Eric Sandeen Date: Thu, 1 Aug 2013 01:13:10 +0000 (+0000) Subject: xfsprogs: fix unint var in repair phase6 X-Git-Tag: v3.2.0-alpha1~65 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=312592defb8b6051389a56a5c780819b4239dab4;p=thirdparty%2Fxfsprogs-dev.git xfsprogs: fix unint var in repair phase6 2 calls to libxfs_bmapi_write exist in repair's phase6 where "first" is uninitialized, but is accessed in that function. Normally we call xfs_bmap_init() first to initialize both the free list and the first block, but in these cases, the free list var is sent as NULL. So in these 2 cases, explicitly initialize the "first" variable to NULLFSBLOCK as xfs_bmap_init() does elsewhere. Coverity caught this. Signed-off-by: Eric Sandeen Reviewed-by: Mark Tinguely --- diff --git a/repair/phase6.c b/repair/phase6.c index 2905a1cff..a60e760c5 100644 --- a/repair/phase6.c +++ b/repair/phase6.c @@ -552,6 +552,7 @@ fill_rbmino(xfs_mount_t *mp) error); } + first = NULLFSBLOCK; while (bno < mp->m_sb.sb_rbmblocks) { /* * fill the file one block at a time @@ -621,6 +622,7 @@ fill_rsumino(xfs_mount_t *mp) error); } + first = NULLFSBLOCK; while (bno < end_bno) { /* * fill the file one block at a time