f2fs-tools: fix potential deadloop
authorChao Yu <yuchao0@huawei.com>
Fri, 9 Aug 2019 10:52:53 +0000 (18:52 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 27 Aug 2019 21:51:05 +0000 (14:51 -0700)
commitb7e0a624711e79c76ffc7eb24d4b6aad4a557071
tree7e2540386d009df947c2cbaafce4522836d77807
parent5eb2d8455992a302aa0b12caf68d8be807712c45
f2fs-tools: fix potential deadloop

In error path of build_sit_info(), start variable is unsigned int type,
it should never be less than zero, fix it.

build_sit_info()
{
...
unsigned int start;
...
free_validity_maps:
for (--start ; start >= 0; --start)
free(sit_i->sentries[start].cur_valid_map);
...
}

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fsck/mount.c