From: "Michael S. Tsirkin" <mst@redhat.com>
To: Sridhar Samudrala <sri@us.ibm.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [PATCH net-next 2/3] net: Fix memcpy_toiovecend() to use the right offset
Date: Sun, 7 Jun 2009 00:13:21 +0300 [thread overview]
Message-ID: <20090606211321.GC28614@redhat.com> (raw)
In-Reply-To: <1244230544.1526.77.camel@w-sridhar.beaverton.ibm.com>
On Fri, Jun 05, 2009 at 12:35:44PM -0700, Sridhar Samudrala wrote:
> 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>
> diff --git a/net/core/iovec.c b/net/core/iovec.c
> index 40a76ce..16ad45d 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;
> }
>
>
>
--
MST
next prev parent reply other threads:[~2009-06-06 21:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-05 19:35 [PATCH net-next 2/3] net: Fix memcpy_toiovecend() to use the right offset Sridhar Samudrala
2009-06-06 21:13 ` Michael S. Tsirkin [this message]
2009-06-08 7:28 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090606211321.GC28614@redhat.com \
--to=mst@redhat.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=sri@us.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.