[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1396972621.16584.13.camel@edumazet-glaptop2.roam.corp.google.com>
Date: Tue, 08 Apr 2014 08:57:01 -0700
From: Eric Dumazet <eric.dumazet@...il.com>
To: Al Viro <viro@...iv.linux.org.uk>
Cc: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: [PATCH] ia64: perfmon: fix a possible file refcnt leak
From: Eric Dumazet <edumazet@...gle.com>
get_file() is called before error checks in pfm_smpl_buffer_alloc()
Signed-off-by: Eric Dumazet <edumazet@...gle.com>
Fixes: cb0942b81249 ("make get_file() return its argument")
---
arch/ia64/kernel/perfmon.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index d841c4bd6864..a7221393612e 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -2297,7 +2297,7 @@ pfm_smpl_buffer_alloc(struct task_struct *task, struct file *filp, pfm_context_t
* partially initialize the vma for the sampling buffer
*/
vma->vm_mm = mm;
- vma->vm_file = get_file(filp);
+ vma->vm_file = filp;
vma->vm_flags = VM_READ|VM_MAYREAD|VM_DONTEXPAND|VM_DONTDUMP;
vma->vm_page_prot = PAGE_READONLY; /* XXX may need to change */
@@ -2342,7 +2342,7 @@ pfm_smpl_buffer_alloc(struct task_struct *task, struct file *filp, pfm_context_t
*/
insert_vm_struct(mm, vma);
- vm_stat_account(vma->vm_mm, vma->vm_flags, vma->vm_file,
+ vm_stat_account(vma->vm_mm, vma->vm_flags, get_file(filp),
vma_pages(vma));
up_write(&task->mm->mmap_sem);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists