Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy...
[pandora-kernel.git] / arch / i386 / kernel / sysenter.c
index c60419d..7de9117 100644 (file)
  * Should the kernel map a VDSO page into processes and pass its
  * address down to glibc upon exec()?
  */
+#ifdef CONFIG_PARAVIRT
+unsigned int __read_mostly vdso_enabled = 0;
+#else
 unsigned int __read_mostly vdso_enabled = 1;
+#endif
 
 EXPORT_SYMBOL_GPL(vdso_enabled);
 
@@ -132,7 +136,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int exstack)
                goto up_fail;
        }
 
-       vma = kmem_cache_zalloc(vm_area_cachep, SLAB_KERNEL);
+       vma = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL);
        if (!vma) {
                ret = -ENOMEM;
                goto up_fail;
@@ -148,8 +152,10 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int exstack)
        vma->vm_mm = mm;
 
        ret = insert_vm_struct(mm, vma);
-       if (ret)
-               goto free_vma;
+       if (unlikely(ret)) {
+               kmem_cache_free(vm_area_cachep, vma);
+               goto up_fail;
+       }
 
        current->mm->context.vdso = (void *)addr;
        current_thread_info()->sysenter_return =
@@ -158,10 +164,6 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int exstack)
 up_fail:
        up_write(&mm->mmap_sem);
        return ret;
-
-free_vma:
-       kmem_cache_free(vm_area_cachep, vma);
-       return ret;
 }
 
 const char *arch_vma_name(struct vm_area_struct *vma)