ext4: unsigned int compared against zero
authorColin Ian King <colin.king@canonical.com>
Sat, 11 May 2019 02:06:38 +0000 (22:06 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 2 May 2020 15:23:19 +0000 (17:23 +0200)
commit5a905c2d2cf2b11676d1c5e9a0a035c1369ae9df
tree8dc6e781884b8abbba4cf6aeba1eb622b5b3b2ba
parent12140f9b8f5aa316b2888b2c876d3b59a7dac524
ext4: unsigned int compared against zero

commit fbbbbd2f28aec991f3fbc248df211550fbdfd58c upstream.

There are two cases where u32 variables n and err are being checked
for less than zero error values, the checks is always false because
the variables are not signed. Fix this by making the variables ints.

Addresses-Coverity: ("Unsigned compared against 0")
Fixes: 345c0dbf3a30 ("ext4: protect journal inode's blocks using block_validity")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Ashwin H <ashwinh@vmware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/block_validity.c