diff options
Diffstat (limited to 'net/core/iovec.c')
-rw-r--r-- | net/core/iovec.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/net/core/iovec.c b/net/core/iovec.c index 5ba18150d..4ebad506e 100644 --- a/net/core/iovec.c +++ b/net/core/iovec.c @@ -104,6 +104,11 @@ out: /* Copy and checkum skb to user iovec. Caller _must_ check that skb will fit to this iovec. + + Returns: 0 - success. + -EINVAL - checksum failure. + -EFAULT - fault during copy. Beware, in this case iovec can be + modified! */ int copy_and_csum_toiovec(struct iovec *iov, struct sk_buff *skb, int hlen) @@ -111,7 +116,7 @@ int copy_and_csum_toiovec(struct iovec *iov, struct sk_buff *skb, int hlen) unsigned int csum; int chunk = skb->len - hlen; - /* Skip filled elements. Pretty silly, look at mecpy_toiove, though 8) */ + /* Skip filled elements. Pretty silly, look at memcpy_toiovec, though 8) */ while (iov->iov_len == 0) iov++; @@ -119,7 +124,7 @@ int copy_and_csum_toiovec(struct iovec *iov, struct sk_buff *skb, int hlen) if ((unsigned short)csum_fold(csum_partial(skb->h.raw, chunk+hlen, skb->csum))) goto csum_error; if (memcpy_toiovec(iov, skb->h.raw + hlen, chunk)) - goto csum_error; + goto fault; } else { int err = 0; csum = csum_partial(skb->h.raw, hlen, skb->csum); @@ -133,6 +138,9 @@ int copy_and_csum_toiovec(struct iovec *iov, struct sk_buff *skb, int hlen) return 0; csum_error: + return -EINVAL; + +fault: return -EFAULT; } |