mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
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>
This commit is contained in:
parent
d2d27bfd11
commit
2faef52b72
1 changed files with 2 additions and 2 deletions
|
@ -112,9 +112,9 @@ int memcpy_toiovecend(const struct iovec *iov, unsigned char *kdata,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
copy = min_t(unsigned int, iov->iov_len - offset, len);
|
copy = min_t(unsigned int, iov->iov_len - offset, len);
|
||||||
offset = 0;
|
if (copy_to_user(iov->iov_base + offset, kdata, copy))
|
||||||
if (copy_to_user(iov->iov_base, kdata, copy))
|
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
|
offset = 0;
|
||||||
kdata += copy;
|
kdata += copy;
|
||||||
len -= copy;
|
len -= copy;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue