aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2021-02-23 20:58:31 -0500
committerTheodore Ts'o <tytso@mit.edu>2021-02-23 20:58:31 -0500
commit7fc56dd147fe7f1a4427f8caed10866e0255eea3 (patch)
tree022eaab4cd92b39d79d37928f81dac6c7c19182f
parentd96064e9821af2d5dbfae7e238dd4e8dac20d72f (diff)
downloade2fsprogs-7fc56dd147fe7f1a4427f8caed10866e0255eea3.tar.gz
debugfs: fix uninitialized variable es in do_logdump()
Fixes: d96064e9821a ("debugfs: simplify the do_logdump() function") Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-rw-r--r--debugfs/logdump.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/debugfs/logdump.c b/debugfs/logdump.c
index b747a92eb..10d413ba7 100644
--- a/debugfs/logdump.c
+++ b/debugfs/logdump.c
@@ -159,6 +159,7 @@ void do_logdump(int argc, char **argv, int sci_idx EXT2FS_ATTR((unused)),
if (!inode_to_dump)
return;
+ es = current_fs->super;
inode_group = ((inode_to_dump - 1)
/ es->s_inodes_per_group);
group_offset = ((inode_to_dump - 1)
@@ -189,7 +190,10 @@ void do_logdump(int argc, char **argv, int sci_idx EXT2FS_ATTR((unused)),
}
}
- if (block_to_dump != ANY_BLOCK && current_fs != NULL) {
+ if (block_to_dump != ANY_BLOCK) {
+ if (check_fs_open(argv[0]))
+ return;
+ es = current_fs->super;
group_to_dump = ((block_to_dump -
es->s_first_data_block)
/ es->s_blocks_per_group);