summaryrefslogtreecommitdiffstats
path: root/lib/iovec.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/iovec.c')
-rw-r--r--lib/iovec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/iovec.c b/lib/iovec.c
index 7a7c2da..df3abd1 100644
--- a/lib/iovec.c
+++ b/lib/iovec.c
@@ -85,6 +85,10 @@ EXPORT_SYMBOL(memcpy_toiovecend);
int memcpy_fromiovecend(unsigned char *kdata, const struct iovec *iov,
int offset, int len)
{
+ /* No data? Done! */
+ if (len == 0)
+ return 0;
+
/* Skip over the finished iovecs */
while (offset >= iov->iov_len) {
offset -= iov->iov_len;
OpenPOWER on IntegriCloud