X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=mm%2Frmap.c;h=98f0bf7fc50d1bdaa16506a466b0508602ef6157;hb=7a8f94b0198aa17034da702f020411ad996f63e2;hp=2c4ee3e9f4f3eb04555fc01524194a0695bcf45a;hpb=1d61507ce4a5642f3c5de0e14227fd182985613a;p=pandora-kernel.git diff --git a/mm/rmap.c b/mm/rmap.c index 2c4ee3e9f4f3..98f0bf7fc50d 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -295,6 +295,13 @@ int anon_vma_clone(struct vm_area_struct *dst, struct vm_area_struct *src) return 0; enomem_failure: + /* + * dst->anon_vma is dropped here otherwise its degree can be incorrectly + * decremented in unlink_anon_vmas(). + * We can safely do this because callers of anon_vma_clone() don't care + * about dst->anon_vma if anon_vma_clone() failed. + */ + dst->anon_vma = NULL; unlink_anon_vmas(dst); return -ENOMEM; }