From: Xiaotian Feng <xtfeng@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Xiaotian Feng <xtfeng@gmail.com>,
Xiaotian Feng <dannyfeng@tencent.com>,
Jeff Layton <jlayton@redhat.com>,
Al Viro <viro@zeniv.linux.org.uk>
Subject: [PATCH] swapfile: fix name leak in swapoff
Date: Thu, 1 Nov 2012 17:36:55 +0800 [thread overview]
Message-ID: <1351762616-2060-1-git-send-email-xtfeng@gmail.com> (raw)
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;
}
--
1.7.9.5
next reply other threads:[~2012-11-01 9:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-01 9:36 Xiaotian Feng [this message]
2012-11-01 10:04 ` Jeff Layton
2012-11-14 19:59 ` Andrew Morton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1351762616-2060-1-git-send-email-xtfeng@gmail.com \
--to=xtfeng@gmail.com \
--cc=dannyfeng@tencent.com \
--cc=jlayton@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome