summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2014-07-31 11:49:48 -0400
committerTheodore Ts'o <tytso@mit.edu>2014-07-31 11:49:48 -0400
commit7d0109c0853e3f7c618a352fdd7c9e4924fadfcf (patch)
tree62a25839a556c42042113511874acb877cf559d0
parent9c2c1e9a3d12563c68d6817b609bbfec0af149cb (diff)
downloade2fsprogs-7d0109c0853e3f7c618a352fdd7c9e4924fadfcf.tar.gz
tune2fs: fix uninitialized variable in remove_journal_device
This bug was introduced by commit 7dfefaf413bbd ("tune2fs: update journal super block when changing UUID for fs"). Fixes-Coverity-Bug: 1229243 Reported-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-rw-r--r--misc/tune2fs.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/misc/tune2fs.c b/misc/tune2fs.c
index 0c1feb1e..639809db 100644
--- a/misc/tune2fs.c
+++ b/misc/tune2fs.c
@@ -232,7 +232,6 @@ static int remove_journal_device(ext2_filsys fs)
errcode_t retval;
int commit_remove_journal = 0;
io_manager io_ptr;
- int start;
if (f_flag)
commit_remove_journal = 1; /* force removal even if error */
@@ -286,8 +285,9 @@ static int remove_journal_device(ext2_filsys fs)
jsb->s_nr_users = htonl(nr_users);
/* Write back the journal superblock */
- if ((retval = io_channel_write_blk64(jfs->io, start,
- -SUPERBLOCK_SIZE, buf))) {
+ if ((retval = io_channel_write_blk64(jfs->io,
+ ext2fs_journal_sb_start(fs->blocksize),
+ -SUPERBLOCK_SIZE, buf))) {
com_err(program_name, retval,
"while writing journal superblock.");
goto no_valid_journal;