diff --git a/net/sunrpc/xdr.c b/net/sunrpc/xdr.c index 155fdaf44fcbab1a65675a8b3cbb9a0aea2f4df7..d0c0f52f76b8c2228bfb8f6d4ca8875c8c7f1dc3 100644 --- a/net/sunrpc/xdr.c +++ b/net/sunrpc/xdr.c @@ -544,7 +544,7 @@ static __be32 *xdr_get_next_encode_buffer(struct xdr_stream *xdr, */ xdr->p = (void *)p + frag2bytes; space_left = xdr->buf->buflen - xdr->buf->len; - if (space_left - nbytes >= PAGE_SIZE) + if (space_left - frag1bytes >= PAGE_SIZE) xdr->end = (void *)p + PAGE_SIZE; else xdr->end = (void *)p + space_left - frag1bytes;