Commit 1001c9fb8721ab395e21f571ed2aaa523cdd1e29

Authored by Daisuke Nishimura
Committed by Linus Torvalds
1 parent 17c9d12e12

migration: migrate_vmas should check "vma"

migrate_vmas() should check "vma" not "vma->vm_next" for for-loop condition.

Signed-off-by: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Cc: Christoph Lameter <cl@linux-foundation.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

... ... @@ -1129,7 +1129,7 @@
1129 1129 struct vm_area_struct *vma;
1130 1130 int err = 0;
1131 1131  
1132   - for(vma = mm->mmap; vma->vm_next && !err; vma = vma->vm_next) {
  1132 + for (vma = mm->mmap; vma && !err; vma = vma->vm_next) {
1133 1133 if (vma->vm_ops && vma->vm_ops->migrate) {
1134 1134 err = vma->vm_ops->migrate(vma, to, from, flags);
1135 1135 if (err)