| To: | "'linux-xfs@xxxxxxxxxxx'" <linux-xfs@xxxxxxxxxxx> |
|---|---|
| Subject: | [PATCH] xfsprogs: fix unint var in repair phase6 |
| From: | Eric Sandeen <sandeen@xxxxxxxxxx> |
| Date: | Wed, 31 Jul 2013 20:13:10 -0500 |
| Delivered-to: | linux-xfs@xxxxxxxxxxx |
| User-agent: | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 |
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@xxxxxxxxxx>
---
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
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: [PATCH 1/3] fs: Introduce new flag FALLOC_FL_COLLAPSE_RANGE, Theodore Ts'o |
|---|---|
| Next by Date: | Re: [PATCH 2/3] xfs: Implement FALLOC_FL_COLLAPSE_RANGE, Dave Chinner |
| Previous by Thread: | Bonjour Que Dieu vous bÃnisse, Rose PETERSON |
| Next by Thread: | [PATCH] xfs: avoid double-free in xfs_attr_node_addname, Eric Sandeen |
| Indexes: | [Date] [Thread] [Top] [All Lists] |