Commit:     ef8aef55ce61fd0e2af798695f7386ac756ae1e7
Parent:     2fbe43f6f631dd7ce19fb1499d6164a5bdb34568
Author:     Herbert Xu <[EMAIL PROTECTED]>
AuthorDate: Thu Sep 6 14:06:35 2007 +0100
Committer:  David S. Miller <[EMAIL PROTECTED](none)>
CommitDate: Tue Sep 11 10:29:07 2007 +0200

    [NET]: Do not dereference iov if length is zero
    When msg_iovlen is zero we shouldn't try to dereference
    msg_iov.  Right now the only thing that tries to do so
    is skb_copy_and_csum_datagram_iovec.  Since the total
    length should also be zero if msg_iovlen is zero, it's
    sufficient to check the total length there and simply
    return if it's zero.
    Signed-off-by: Herbert Xu <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
 net/core/datagram.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/net/core/datagram.c b/net/core/datagram.c
index cb056f4..029b93e 100644
--- a/net/core/datagram.c
+++ b/net/core/datagram.c
@@ -450,6 +450,9 @@ int skb_copy_and_csum_datagram_iovec(struct sk_buff *skb,
        __wsum csum;
        int chunk = skb->len - hlen;
+       if (!chunk)
+               return 0;
        /* Skip filled elements.
         * Pretty silly, look at memcpy_toiovec, though 8)
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to