diff options
| -rw-r--r-- | drivers/net/ppp_generic.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c index 75e8903c3754..8518a2e58e53 100644 --- a/drivers/net/ppp_generic.c +++ b/drivers/net/ppp_generic.c | |||
| @@ -405,6 +405,7 @@ static ssize_t ppp_read(struct file *file, char __user *buf, | |||
| 405 | DECLARE_WAITQUEUE(wait, current); | 405 | DECLARE_WAITQUEUE(wait, current); |
| 406 | ssize_t ret; | 406 | ssize_t ret; |
| 407 | struct sk_buff *skb = NULL; | 407 | struct sk_buff *skb = NULL; |
| 408 | struct iovec iov; | ||
| 408 | 409 | ||
| 409 | ret = count; | 410 | ret = count; |
| 410 | 411 | ||
| @@ -448,7 +449,9 @@ static ssize_t ppp_read(struct file *file, char __user *buf, | |||
| 448 | if (skb->len > count) | 449 | if (skb->len > count) |
| 449 | goto outf; | 450 | goto outf; |
| 450 | ret = -EFAULT; | 451 | ret = -EFAULT; |
| 451 | if (copy_to_user(buf, skb->data, skb->len)) | 452 | iov.iov_base = buf; |
| 453 | iov.iov_len = count; | ||
| 454 | if (skb_copy_datagram_iovec(skb, 0, &iov, skb->len)) | ||
| 452 | goto outf; | 455 | goto outf; |
| 453 | ret = skb->len; | 456 | ret = skb->len; |
| 454 | 457 | ||
