From: Mel Gorman Date: Fri, 28 Sep 2012 00:19:12 +0000 (+1000) Subject: mempolicy-fix-a-memory-corruption-by-refcount-imbalance-in-alloc_pages_vma-v2 X-Git-Tag: next-20121004~1^2~343 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=a586d928ca12a36e060e68e758421273c2266ed7;p=karo-tx-linux.git mempolicy-fix-a-memory-corruption-by-refcount-imbalance-in-alloc_pages_vma-v2 Signed-off-by: KOSAKI Motohiro Signed-off-by: Mel Gorman Reviewed-by: Christoph Lameter Cc: Josh Boyer Signed-off-by: Andrew Morton --- diff --git a/mm/mempolicy.c b/mm/mempolicy.c index f14ae9adec20..9cc60d45d20f 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -1604,16 +1604,13 @@ struct mempolicy *get_vma_policy(struct task_struct *task, struct vm_area_struct *vma, unsigned long addr) { struct mempolicy *pol = get_task_policy(task); - int got_ref; if (vma) { if (vma->vm_ops && vma->vm_ops->get_policy) { struct mempolicy *vpol = vma->vm_ops->get_policy(vma, addr); - if (vpol) { + if (vpol) pol = vpol; - got_ref = 1; - } } else if (vma->vm_policy) { pol = vma->vm_policy;