Commit 151d8122 authored by Sergey Shtylyov's avatar Sergey Shtylyov Committed by Mike Snitzer

dm ioctl: drop always-false condition

The expression 'indata[3] > ULONG_MAX' always evaluates to false since
indata[] is declared as an array of *unsigned long* elements and #define
ULONG_MAX represents the max value of that exact type...

Note that gcc seems to be able to detect the dead code here and eliminate
this check anyway...

Found by Linux Verification Center (linuxtesting.org) with the SVACE static
analysis tool.
Signed-off-by: default avatarSergey Shtylyov <s.shtylyov@omp.ru>
Reviewed-by: default avatarMikulas Patocka <mpatocka@redhat.com>
Signed-off-by: default avatarMike Snitzer <snitzer@kernel.org>
parent aa56b9b7
...@@ -1073,8 +1073,7 @@ static int dev_set_geometry(struct file *filp, struct dm_ioctl *param, size_t pa ...@@ -1073,8 +1073,7 @@ static int dev_set_geometry(struct file *filp, struct dm_ioctl *param, size_t pa
goto out; goto out;
} }
if (indata[0] > 65535 || indata[1] > 255 || if (indata[0] > 65535 || indata[1] > 255 || indata[2] > 255) {
indata[2] > 255 || indata[3] > ULONG_MAX) {
DMERR("Geometry exceeds range limits."); DMERR("Geometry exceeds range limits.");
goto out; goto out;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment