aboutsummaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorGravatar Trond Myklebust <trond.myklebust@hammerspace.com> 2023-09-13 16:12:33 -0400
committerGravatar Anna Schumaker <Anna.Schumaker@Netapp.com> 2023-09-15 15:50:39 -0400
commit993b5662f302628db4eb358d69b2720c88cbfaf0 (patch)
treeb257399d294e6d3e23fd0f80f14b843a73b8d545 /include/linux
parentRevert "SUNRPC: clean up integer overflow check" (diff)
downloadlinux-993b5662f302628db4eb358d69b2720c88cbfaf0.tar.gz
linux-993b5662f302628db4eb358d69b2720c88cbfaf0.tar.bz2
linux-993b5662f302628db4eb358d69b2720c88cbfaf0.zip
SUNRPC: Silence compiler complaints about tautological comparisons
On 64-bit systems, the compiler will complain that the comparison between SIZE_MAX and the 32-bit unsigned int 'len' is unnecessary. Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/sunrpc/xdr.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h
index 896a6d2a9cf0..2f8dc47f1eb0 100644
--- a/include/linux/sunrpc/xdr.h
+++ b/include/linux/sunrpc/xdr.h
@@ -779,7 +779,7 @@ xdr_stream_decode_uint32_array(struct xdr_stream *xdr,
if (unlikely(xdr_stream_decode_u32(xdr, &len) < 0))
return -EBADMSG;
- if (len > SIZE_MAX / sizeof(*p))
+ if (U32_MAX >= SIZE_MAX / sizeof(*p) && len > SIZE_MAX / sizeof(*p))
return -EBADMSG;
p = xdr_inline_decode(xdr, len * sizeof(*p));
if (unlikely(!p))