]> git.itanic.dy.fi Git - linux-stable/commit
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>
Mon, 16 Sep 2019 06:22:24 +0000 (08:22 +0200)
commitff69322509bb3f48c4e08cc3bef7c414519a7862
treec844054a6aaeb9a3ba1be17c9d75a5f109064408
parent292666d2d868f30a55f6d5f15c5a1a16a38a99c5
ext4: unsigned int compared against zero

[ Upstream commit fbbbbd2f28aec991f3fbc248df211550fbdfd58c ]

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: Sasha Levin <sashal@kernel.org>
fs/ext4/block_validity.c