All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] swapfile: fix name leak in swapoff
@ 2012-11-01  9:36 Xiaotian Feng
  2012-11-01 10:04 ` Jeff Layton
  2012-11-14 19:59 ` Andrew Morton
  0 siblings, 2 replies; 3+ messages in thread
From: Xiaotian Feng @ 2012-11-01  9:36 UTC (permalink / raw)
  To: linux-kernel; +Cc: Xiaotian Feng, Xiaotian Feng, Jeff Layton, Al Viro

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-11-14 19:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-01  9:36 [PATCH] swapfile: fix name leak in swapoff Xiaotian Feng
2012-11-01 10:04 ` Jeff Layton
2012-11-14 19:59 ` Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.