mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-09 06:41:06 -04:00
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>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user