X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=mm%2Frmap.c;h=3e4c7213210c6f22a0da6f88c13689a9c99b92f1;hb=6d3d6aa22af30580cde0d2e23890027bb47a3544;hp=19886fb2f13aac6a659ba1ae8b9e4db2f8efa7a4;hpb=df717a58a38c49cf7c6e761d35aa822344dbd1bd;p=mirror_ubuntu-zesty-kernel.git diff --git a/mm/rmap.c b/mm/rmap.c index 19886fb2f13a..3e4c7213210c 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -274,6 +274,7 @@ int anon_vma_fork(struct vm_area_struct *vma, struct vm_area_struct *pvma) { struct anon_vma_chain *avc; struct anon_vma *anon_vma; + int error; /* Don't bother if the parent process has no anon_vma here. */ if (!pvma->anon_vma) @@ -283,8 +284,9 @@ int anon_vma_fork(struct vm_area_struct *vma, struct vm_area_struct *pvma) * First, attach the new VMA to the parent VMA's anon_vmas, * so rmap can find non-COWed pages in child processes. */ - if (anon_vma_clone(vma, pvma)) - return -ENOMEM; + error = anon_vma_clone(vma, pvma); + if (error) + return error; /* Then add our own anon_vma. */ anon_vma = anon_vma_alloc();