Skip to contentSkip to conversation

Patch "mm/swapfile.c: fix swapon frontswap_map memory leak on error" has been added to the 4.12-stable tree

PATCH [email protected] 1 participant 1 message Sep 10, 2017

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

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 <[email protected]> know about it.

Quoted 1 line

From b6b1fd2a6bedd533aeed83924d7be0e944fded9f Mon Sep 17 00:00:00 2001

From: David Rientjes <[email protected]>
Date: Fri, 8 Sep 2017 16:13:29 -0700
Subject: mm/swapfile.c: fix swapon frontswap_map memory leak on error

From: David Rientjes <[email protected]>

commit b6b1fd2a6bedd533aeed83924d7be0e944fded9f upstream.

Free frontswap_map if an error is encountered before enable_swap_info().

---
 mm/swapfile.c |    1 +
 1 file changed, 1 insertion(+)
mm/swapfile.c +1 -0
@@ -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 [email protected] 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