ext4: fix potential uninitialized access to retval in kmmpd

if (!ext4_has_feature_mmp(sb)) then retval can be unitialized before
we jump to the wait_to_exit label.

Fixes: 61bb4a1c41 ("ext4: fix possible UAF when remounting r/o a mmp-protected file system")
Signed-off-by: Ye Bin <yebin10@huawei.com>
Link: https://lore.kernel.org/r/20210713022728.2533770-1-yebin10@huawei.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
This commit is contained in:
Ye Bin 2021-07-13 10:27:28 +08:00 committed by Theodore Ts'o
parent 2734d6c1b1
commit b665414228
1 changed files with 1 additions and 1 deletions

View File

@ -138,7 +138,7 @@ static int kmmpd(void *data)
unsigned mmp_check_interval; unsigned mmp_check_interval;
unsigned long last_update_time; unsigned long last_update_time;
unsigned long diff; unsigned long diff;
int retval; int retval = 0;
mmp_block = le64_to_cpu(es->s_mmp_block); mmp_block = le64_to_cpu(es->s_mmp_block);
mmp = (struct mmp_struct *)(bh->b_data); mmp = (struct mmp_struct *)(bh->b_data);