]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfsprogs: fix unint var in repair phase6
authorEric Sandeen <sandeen@redhat.com>
Thu, 1 Aug 2013 01:13:10 +0000 (01:13 +0000)
committerMark Tinguely <tinguely@eagdhcp-232-140.americas.sgi.com>
Fri, 9 Aug 2013 13:23:48 +0000 (08:23 -0500)
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 <sandeen@redhat.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
repair/phase6.c

index 2905a1cff925bd2c61313b2b7853b7e6a52d95a1..a60e760c5c8c9683ce503f9fd4679d0591d601c7 100644 (file)
@@ -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