lkml.org 
[lkml]   [2012]   [Nov]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] swapfile: fix name leak in swapoff
On Thu,  1 Nov 2012 17:36:55 +0800
Xiaotian Feng <xtfeng@gmail.com> wrote:

> there's a name leak introduced by commit 91a27b2, add the missing
> putname.
>
> Signed-off-by: Xiaotian Feng <dannyfeng@tencent.com>
> Cc: Jeff Layton <jlayton@redhat.com>
> Cc: Al Viro <viro@zeniv.linux.org.uk>
> ---
> mm/swapfile.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/mm/swapfile.c b/mm/swapfile.c
> index 71cd288..459fe30 100644
> --- a/mm/swapfile.c
> +++ b/mm/swapfile.c
> @@ -1608,6 +1608,8 @@ SYSCALL_DEFINE1(swapoff, const char __user *, specialfile)
> out_dput:
> filp_close(victim, NULL);
> out:
> + if (pathname && !IS_ERR(pathname))
> + putname(pathname);
> return err;
> }
>

Nice catch.

Reviewed-by: Jeff Layton <jlayton@redhat.com>


\
 
 \ /
  Last update: 2012-11-01 11:41    [W:0.032 / U:0.484 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site