In ext2fs_run_ext3_journal(), fs will be freed and reallocated.
However, the reallocation by ext2fs_open() may fail in some cases ---
for example, when the device becomes offline. To avoid a segfault,
exit if fs is NULL.
[ Simplified the patch by by simply exiting if fs is NULL -TYT ]
Signed-off-by: Li Jinlin <lijinlin3@huawei.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
com_err("tune2fs", retval,
"while recovering journal.\n");
printf(_("Please run e2fsck -fy %s.\n"), argv[1]);
+ if (!fs)
+ exit(1);
rc = 1;
goto closefs;
}