diff options
author | Trond Myklebust <trond.myklebust@hammerspace.com> | 2020-12-06 12:41:41 -0500 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@hammerspace.com> | 2020-12-14 06:51:07 -0500 |
commit | e43ac22b83921928479da0bad25aaee3d95c2b1a (patch) | |
tree | 9d28f263bc585e3298240b98d8c875e70865dc41 /net | |
parent | 6707fbd7d3be72da4ebde7f56b46814befd2db19 (diff) | |
download | linux-e43ac22b83921928479da0bad25aaee3d95c2b1a.tar.gz linux-e43ac22b83921928479da0bad25aaee3d95c2b1a.tar.bz2 linux-e43ac22b83921928479da0bad25aaee3d95c2b1a.zip |
SUNRPC: _copy_to/from_pages() now check for zero length
Clean up callers of _copy_to/from_pages() that still check for a zero
length.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/sunrpc/xdr.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/net/sunrpc/xdr.c b/net/sunrpc/xdr.c index 19eaa38f7d16..01918e60b67b 100644 --- a/net/sunrpc/xdr.c +++ b/net/sunrpc/xdr.c @@ -1665,8 +1665,7 @@ static void __read_bytes_from_xdr_buf(struct xdr_buf *subbuf, void *obj, unsigne len -= this_len; obj += this_len; this_len = min_t(unsigned int, len, subbuf->page_len); - if (this_len) - _copy_from_pages(obj, subbuf->pages, subbuf->page_base, this_len); + _copy_from_pages(obj, subbuf->pages, subbuf->page_base, this_len); len -= this_len; obj += this_len; this_len = min_t(unsigned int, len, subbuf->tail[0].iov_len); @@ -1696,8 +1695,7 @@ static void __write_bytes_to_xdr_buf(struct xdr_buf *subbuf, void *obj, unsigned len -= this_len; obj += this_len; this_len = min_t(unsigned int, len, subbuf->page_len); - if (this_len) - _copy_to_pages(subbuf->pages, subbuf->page_base, obj, this_len); + _copy_to_pages(subbuf->pages, subbuf->page_base, obj, this_len); len -= this_len; obj += this_len; this_len = min_t(unsigned int, len, subbuf->tail[0].iov_len); |