sysctl: remove duplicate UINT_MAX check on do_proc_douintvec_conv()
Subsystems (2)
PATCH 1/1 sysctl: remove duplicate UINT_MAX check on do_proc_douintvec_conv()
do_proc_douintvec_conv() has two UINT_MAX checks, we can remove one. This has no functional changes other than fixing a compiler warning:
kernel/sysctl.c:2190]: (warning) Identical condition '*lvalp>UINT_MAX', second condition is always false
Reported-by David Binderman <[email protected]>
Signed-off-by Luis R. Rodriguez <[email protected]>
--- kernel/sysctl.c | 2 -- 1 file changed, 2 deletions(-)
kernel/sysctl.c +0 -2
@@ -2181,8 +2181,6 @@ static int do_proc_douintvec_conv(unsigned long *lvalp, int write, void *data) {if (write) { -if (*lvalp >UINT_MAX ) -return -EINVAL ;if (*lvalp >UINT_MAX )return -EINVAL ; *valp = *lvalp;
Signature · 1 line
2.14.0
Quoted 7 lines · Luis R. Rodriguez
do_proc_douintvec_conv()has twoUINT_MAXchecks, we can remove one. This has no functional changes other than fixing a compiler warning:
kernel/sysctl.c:2190]: (warning) Identical condition '*lvalp>UINT_MAX', second condition is always falseReported-by David Binderman <[email protected]>Signed-off-by Luis R. Rodriguez <[email protected]>
Fixes 4f2fec00afa60 ("sysctl: simplify unsigned int support")
Acked-by Kees Cook <[email protected]>
-Kees
Quoted 20 lines
--- kernel/sysctl.c | 2 -- 1 file changed, 2 deletions(-)kernel/sysctl.c +0
-3@@ -2181,8 +2181,6 @@ static int do_proc_douintvec_conv(unsigned long *lvalp, int write, void *data) {if (write) { -if (*lvalp >UINT_MAX ) -return -EINVAL ;if (*lvalp >UINT_MAX )return -EINVAL ; *valp = *lvalp; --2.14.0
Signature · 2 lines
Kees Cook Pixel Security