diff options
author | Sergey Shtylyov <s.shtylyov@omp.ru> | 2023-01-17 21:59:55 +0100 |
---|---|---|
committer | Mike Snitzer <snitzer@kernel.org> | 2023-02-02 20:26:09 +0100 |
commit | 151d812251202aa0dce1fdeabd64794292d40b75 (patch) | |
tree | 87056e0174a2364649968000948aeb3265e24664 /drivers/md/dm-ioctl.c | |
parent | dm flakey: fix logic when corrupting a bio (diff) | |
download | linux-151d812251202aa0dce1fdeabd64794292d40b75.tar.xz linux-151d812251202aa0dce1fdeabd64794292d40b75.zip |
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: Sergey Shtylyov <s.shtylyov@omp.ru>
Reviewed-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Diffstat (limited to '')
-rw-r--r-- | drivers/md/dm-ioctl.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c index 36fc6ae4737a..9160159ef881 100644 --- a/drivers/md/dm-ioctl.c +++ b/drivers/md/dm-ioctl.c @@ -1073,8 +1073,7 @@ static int dev_set_geometry(struct file *filp, struct dm_ioctl *param, size_t pa goto out; } - if (indata[0] > 65535 || indata[1] > 255 || - indata[2] > 255 || indata[3] > ULONG_MAX) { + if (indata[0] > 65535 || indata[1] > 255 || indata[2] > 255) { DMERR("Geometry exceeds range limits."); goto out; } |