diff options
author | Sridhar Samudrala <sri@us.ibm.com> | 2009-06-05 11:35:44 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-06-08 09:25:39 +0200 |
commit | 2faef52b72958b8b1c08e927b9b0691c314cf6f4 (patch) | |
tree | d23b72d99342dd067dd9753d8b1286236831f54e /net/core/iovec.c | |
parent | net: Fix skb_copy_datagram_from_iovec() to pass the right offset (diff) | |
download | linux-2faef52b72958b8b1c08e927b9b0691c314cf6f4.tar.xz linux-2faef52b72958b8b1c08e927b9b0691c314cf6f4.zip |
net: Fix memcpy_toiovecend() to use the right offset
Increment the iovec base by the offset passed in for the initial
copy_to_user() in memcpy_to_iovecend().
Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/iovec.c')
-rw-r--r-- | net/core/iovec.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/core/iovec.c b/net/core/iovec.c index 40a76ce19d9f..16ad45d4882b 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; } |