summaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-verity.c
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2013-07-10 23:41:17 +0100
committerAlasdair G Kergon <agk@redhat.com>2013-07-10 23:41:17 +0100
commit5d8be84397618a2c04ec2b74d5d5a3d852a2ee5a (patch)
tree47b6d39cec72b8c9a18d9c38853e1a20a0fd254e /drivers/md/dm-verity.c
parent220cd058d9b66b940105e0a32324f06d557deba7 (diff)
downloadtalos-obmc-linux-5d8be84397618a2c04ec2b74d5d5a3d852a2ee5a.tar.gz
talos-obmc-linux-5d8be84397618a2c04ec2b74d5d5a3d852a2ee5a.zip
dm verity: remove pointless comparison
Remove num < 0 test in verity_ctr because num is unsigned. (Found by Coverity.) Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md/dm-verity.c')
-rw-r--r--drivers/md/dm-verity.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/md/dm-verity.c b/drivers/md/dm-verity.c
index 0d2e812d424b..9804da16a476 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;
OpenPOWER on IntegriCloud