diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/bio.c | 5 | ||||
-rw-r--r-- | fs/locks.c | 2 |
2 files changed, 5 insertions, 2 deletions
@@ -654,9 +654,10 @@ static struct bio *__bio_map_user_iov(request_queue_t *q, | |||
654 | write_to_vm, 0, &pages[cur_page], NULL); | 654 | write_to_vm, 0, &pages[cur_page], NULL); |
655 | up_read(¤t->mm->mmap_sem); | 655 | up_read(¤t->mm->mmap_sem); |
656 | 656 | ||
657 | if (ret < local_nr_pages) | 657 | if (ret < local_nr_pages) { |
658 | ret = -EFAULT; | ||
658 | goto out_unmap; | 659 | goto out_unmap; |
659 | 660 | } | |
660 | 661 | ||
661 | offset = uaddr & ~PAGE_MASK; | 662 | offset = uaddr & ~PAGE_MASK; |
662 | for (j = cur_page; j < page_limit; j++) { | 663 | for (j = cur_page; j < page_limit; j++) { |
diff --git a/fs/locks.c b/fs/locks.c index 6f99c0a6f836..ab61a8b54829 100644 --- a/fs/locks.c +++ b/fs/locks.c | |||
@@ -755,6 +755,7 @@ static int flock_lock_file(struct file *filp, struct file_lock *request) | |||
755 | if (request->fl_type == F_UNLCK) | 755 | if (request->fl_type == F_UNLCK) |
756 | goto out; | 756 | goto out; |
757 | 757 | ||
758 | error = -ENOMEM; | ||
758 | new_fl = locks_alloc_lock(); | 759 | new_fl = locks_alloc_lock(); |
759 | if (new_fl == NULL) | 760 | if (new_fl == NULL) |
760 | goto out; | 761 | goto out; |
@@ -781,6 +782,7 @@ static int flock_lock_file(struct file *filp, struct file_lock *request) | |||
781 | locks_copy_lock(new_fl, request); | 782 | locks_copy_lock(new_fl, request); |
782 | locks_insert_lock(&inode->i_flock, new_fl); | 783 | locks_insert_lock(&inode->i_flock, new_fl); |
783 | new_fl = NULL; | 784 | new_fl = NULL; |
785 | error = 0; | ||
784 | 786 | ||
785 | out: | 787 | out: |
786 | unlock_kernel(); | 788 | unlock_kernel(); |