diff options
Diffstat (limited to 'fs/read_write.c')
| -rw-r--r-- | fs/read_write.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/read_write.c b/fs/read_write.c index ffc99d22e0a3..c20614f86c01 100644 --- a/fs/read_write.c +++ b/fs/read_write.c | |||
| @@ -633,8 +633,7 @@ ssize_t do_loop_readv_writev(struct file *filp, struct iovec *iov, | |||
| 633 | ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector, | 633 | ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector, |
| 634 | unsigned long nr_segs, unsigned long fast_segs, | 634 | unsigned long nr_segs, unsigned long fast_segs, |
| 635 | struct iovec *fast_pointer, | 635 | struct iovec *fast_pointer, |
| 636 | struct iovec **ret_pointer, | 636 | struct iovec **ret_pointer) |
| 637 | int check_access) | ||
| 638 | { | 637 | { |
| 639 | unsigned long seg; | 638 | unsigned long seg; |
| 640 | ssize_t ret; | 639 | ssize_t ret; |
| @@ -690,7 +689,7 @@ ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector, | |||
| 690 | ret = -EINVAL; | 689 | ret = -EINVAL; |
| 691 | goto out; | 690 | goto out; |
| 692 | } | 691 | } |
| 693 | if (check_access | 692 | if (type >= 0 |
| 694 | && unlikely(!access_ok(vrfy_dir(type), buf, len))) { | 693 | && unlikely(!access_ok(vrfy_dir(type), buf, len))) { |
| 695 | ret = -EFAULT; | 694 | ret = -EFAULT; |
| 696 | goto out; | 695 | goto out; |
| @@ -723,7 +722,7 @@ static ssize_t do_readv_writev(int type, struct file *file, | |||
| 723 | } | 722 | } |
| 724 | 723 | ||
| 725 | ret = rw_copy_check_uvector(type, uvector, nr_segs, | 724 | ret = rw_copy_check_uvector(type, uvector, nr_segs, |
| 726 | ARRAY_SIZE(iovstack), iovstack, &iov, 1); | 725 | ARRAY_SIZE(iovstack), iovstack, &iov); |
| 727 | if (ret <= 0) | 726 | if (ret <= 0) |
| 728 | goto out; | 727 | goto out; |
| 729 | 728 | ||
