summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/core/iovec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/core/iovec.c b/net/core/iovec.c
index 40a76ce19d9..16ad45d4882 100644
--- a/net/core/iovec.c
+++ b/net/core/iovec.c
@@ -112,9 +112,9 @@ int memcpy_toiovecend(const struct iovec *iov, unsigned char *kdata,
continue;
}
copy = min_t(unsigned int, iov->iov_len - offset, len);
- offset = 0;
- if (copy_to_user(iov->iov_base, kdata, copy))
+ if (copy_to_user(iov->iov_base + offset, kdata, copy))
return -EFAULT;
+ offset = 0;
kdata += copy;
len -= copy;
}