diff options
Diffstat (limited to 'lib/iovec.c')
-rw-r--r-- | lib/iovec.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/iovec.c b/lib/iovec.c index 7a7c2da4cddf..df3abd1eaa4a 100644 --- a/lib/iovec.c +++ b/lib/iovec.c | |||
@@ -85,6 +85,10 @@ EXPORT_SYMBOL(memcpy_toiovecend); | |||
85 | int memcpy_fromiovecend(unsigned char *kdata, const struct iovec *iov, | 85 | int memcpy_fromiovecend(unsigned char *kdata, const struct iovec *iov, |
86 | int offset, int len) | 86 | int offset, int len) |
87 | { | 87 | { |
88 | /* No data? Done! */ | ||
89 | if (len == 0) | ||
90 | return 0; | ||
91 | |||
88 | /* Skip over the finished iovecs */ | 92 | /* Skip over the finished iovecs */ |
89 | while (offset >= iov->iov_len) { | 93 | while (offset >= iov->iov_len) { |
90 | offset -= iov->iov_len; | 94 | offset -= iov->iov_len; |