From: Mikulas Patocka Date: Wed, 10 Jul 2013 22:41:17 +0000 (+0100) Subject: dm verity: remove pointless comparison X-Git-Tag: v3.11-rc1~20^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5d8be84397618a2c04ec2b74d5d5a3d852a2ee5a;p=platform%2Fkernel%2Flinux-stable.git dm verity: remove pointless comparison Remove num < 0 test in verity_ctr because num is unsigned. (Found by Coverity.) Signed-off-by: Mikulas Patocka Signed-off-by: Alasdair G Kergon --- diff --git a/drivers/md/dm-verity.c b/drivers/md/dm-verity.c index 0d2e812..9804da1 100644 --- a/drivers/md/dm-verity.c +++ b/drivers/md/dm-verity.c @@ -695,8 +695,8 @@ static int verity_ctr(struct dm_target *ti, unsigned argc, char **argv) goto bad; } - if (sscanf(argv[0], "%d%c", &num, &dummy) != 1 || - num < 0 || num > 1) { + if (sscanf(argv[0], "%u%c", &num, &dummy) != 1 || + num > 1) { ti->error = "Invalid version"; r = -EINVAL; goto bad;