public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfsprogs: fix unint var in repair phase6
@ 2013-08-01  1:13 Eric Sandeen
  2013-08-01 14:50 ` Mark Tinguely
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Sandeen @ 2013-08-01  1:13 UTC (permalink / raw)
  To: 'linux-xfs@oss.sgi.com'

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>
---

diff --git a/repair/phase6.c b/repair/phase6.c
index 5c33797..119ec3b 100644
--- a/repair/phase6.c
+++ b/repair/phase6.c
@@ -536,6 +536,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
@@ -605,6 +606,7 @@ fill_rsumino(xfs_mount_t *mp)
 			error);
 	}
 
+	first = NULLFSBLOCK;
 	while (bno < end_bno)  {
 		/*
 		 * fill the file one block at a time

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-08-01 14:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-01  1:13 [PATCH] xfsprogs: fix unint var in repair phase6 Eric Sandeen
2013-08-01 14:50 ` Mark Tinguely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox