summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2024-09-10 15:31:19 -0400
committerChuck Lever <chuck.lever@oracle.com>2024-09-20 19:31:39 -0400
commit663ad8b1df8724cd5e01df66ea67ce0424fbcdf6 (patch)
tree20cce90e2f2644cc235f6809ce3104daf3a78b3d /include
parent4b132aacb0768ac1e652cf517097ea6f237214b9 (diff)
xdrgen: Fix return code checking in built-in XDR decoders
xdr_stream_encode_u32() returns XDR_UNIT on success. xdr_stream_decode_u32() returns zero or -EMSGSIZE, but never XDR_UNIT. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/sunrpc/xdrgen/_builtins.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/sunrpc/xdrgen/_builtins.h b/include/linux/sunrpc/xdrgen/_builtins.h
index 68746c59fc9a..66ca3ece951a 100644
--- a/include/linux/sunrpc/xdrgen/_builtins.h
+++ b/include/linux/sunrpc/xdrgen/_builtins.h
@@ -184,7 +184,7 @@ xdrgen_decode_string(struct xdr_stream *xdr, string *ptr, u32 maxlen)
__be32 *p;
u32 len;
- if (unlikely(xdr_stream_decode_u32(xdr, &len) != XDR_UNIT))
+ if (unlikely(xdr_stream_decode_u32(xdr, &len) < 0))
return false;
if (unlikely(maxlen && len > maxlen))
return false;
@@ -215,7 +215,7 @@ xdrgen_decode_opaque(struct xdr_stream *xdr, opaque *ptr, u32 maxlen)
__be32 *p;
u32 len;
- if (unlikely(xdr_stream_decode_u32(xdr, &len) != XDR_UNIT))
+ if (unlikely(xdr_stream_decode_u32(xdr, &len) < 0))
return false;
if (unlikely(maxlen && len > maxlen))
return false;