lkml.org 
[lkml]   [2014]   [Apr]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] ia64: perfmon: fix a possible file refcnt leak
From
Date
From: Eric Dumazet <edumazet@google.com>

get_file() is called before error checks in pfm_smpl_buffer_alloc()

Signed-off-by: Eric Dumazet <edumazet@google.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);




\
 
 \ /
  Last update: 2014-04-08 18:21    [W:0.023 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site