diff options
Diffstat (limited to 'mm/mempolicy.c')
-rw-r--r-- | mm/mempolicy.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 7dd9d9f80694..4545d5944243 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c | |||
@@ -1024,7 +1024,7 @@ static long do_mbind(unsigned long start, unsigned long len, | |||
1024 | 1024 | ||
1025 | err = migrate_prep(); | 1025 | err = migrate_prep(); |
1026 | if (err) | 1026 | if (err) |
1027 | return err; | 1027 | goto mpol_out; |
1028 | } | 1028 | } |
1029 | { | 1029 | { |
1030 | NODEMASK_SCRATCH(scratch); | 1030 | NODEMASK_SCRATCH(scratch); |
@@ -1039,10 +1039,9 @@ static long do_mbind(unsigned long start, unsigned long len, | |||
1039 | err = -ENOMEM; | 1039 | err = -ENOMEM; |
1040 | NODEMASK_SCRATCH_FREE(scratch); | 1040 | NODEMASK_SCRATCH_FREE(scratch); |
1041 | } | 1041 | } |
1042 | if (err) { | 1042 | if (err) |
1043 | mpol_put(new); | 1043 | goto mpol_out; |
1044 | return err; | 1044 | |
1045 | } | ||
1046 | vma = check_range(mm, start, end, nmask, | 1045 | vma = check_range(mm, start, end, nmask, |
1047 | flags | MPOL_MF_INVERT, &pagelist); | 1046 | flags | MPOL_MF_INVERT, &pagelist); |
1048 | 1047 | ||
@@ -1058,9 +1057,11 @@ static long do_mbind(unsigned long start, unsigned long len, | |||
1058 | 1057 | ||
1059 | if (!err && nr_failed && (flags & MPOL_MF_STRICT)) | 1058 | if (!err && nr_failed && (flags & MPOL_MF_STRICT)) |
1060 | err = -EIO; | 1059 | err = -EIO; |
1061 | } | 1060 | } else |
1061 | putback_lru_pages(&pagelist); | ||
1062 | 1062 | ||
1063 | up_write(&mm->mmap_sem); | 1063 | up_write(&mm->mmap_sem); |
1064 | mpol_out: | ||
1064 | mpol_put(new); | 1065 | mpol_put(new); |
1065 | return err; | 1066 | return err; |
1066 | } | 1067 | } |