From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:34530 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751551AbdIJLtR (ORCPT ); Sun, 10 Sep 2017 07:49:17 -0400 Subject: Patch "mm/swapfile.c: fix swapon frontswap_map memory leak on error" has been added to the 4.12-stable tree To: rientjes@google.com, akpm@linux-foundation.org, darrick.wong@oracle.com, gregkh@linuxfoundation.org, hughd@google.com, torvalds@linux-foundation.org, ying.huang@intel.com Cc: , From: Date: Sun, 10 Sep 2017 13:37:14 +0200 Message-ID: <1505043434154201@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled mm/swapfile.c: fix swapon frontswap_map memory leak on error to the 4.12-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: mm-swapfile.c-fix-swapon-frontswap_map-memory-leak-on-error.patch and it can be found in the queue-4.12 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From b6b1fd2a6bedd533aeed83924d7be0e944fded9f Mon Sep 17 00:00:00 2001 From: David Rientjes Date: Fri, 8 Sep 2017 16:13:29 -0700 Subject: mm/swapfile.c: fix swapon frontswap_map memory leak on error From: David Rientjes commit b6b1fd2a6bedd533aeed83924d7be0e944fded9f upstream. Free frontswap_map if an error is encountered before enable_swap_info(). Signed-off-by: David Rientjes Reviewed-by: "Huang, Ying" Cc: Darrick J. Wong Cc: Hugh Dickins Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- mm/swapfile.c | 1 + 1 file changed, 1 insertion(+) --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -2904,6 +2904,7 @@ bad_swap: spin_unlock(&swap_lock); vfree(swap_map); kvfree(cluster_info); + kvfree(frontswap_map); if (swap_file) { if (inode && S_ISREG(inode->i_mode)) { inode_unlock(inode); Patches currently in stable-queue which might be from rientjes@google.com are queue-4.12/mm-swapfile.c-fix-swapon-frontswap_map-memory-leak-on-error.patch queue-4.12/mm-kvfree-the-swap-cluster-info-if-the-swap-file-is-unsatisfactory.patch