From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757952Ab2KAJg3 (ORCPT ); Thu, 1 Nov 2012 05:36:29 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:56144 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752361Ab2KAJg1 (ORCPT ); Thu, 1 Nov 2012 05:36:27 -0400 From: Xiaotian Feng To: linux-kernel@vger.kernel.org Cc: Xiaotian Feng , Xiaotian Feng , Jeff Layton , Al Viro Subject: [PATCH] swapfile: fix name leak in swapoff Date: Thu, 1 Nov 2012 17:36:55 +0800 Message-Id: <1351762616-2060-1-git-send-email-xtfeng@gmail.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org there's a name leak introduced by commit 91a27b2, add the missing putname. Signed-off-by: Xiaotian Feng Cc: Jeff Layton Cc: Al Viro --- 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