Skip to contentSkip to conversation

Patch "btrfs: tests: Fix a memory leak in error handling path in 'run_test()'" has been added to the 4.14-stable tree

PATCH [email protected] 1 participant 1 message Dec 18, 2017

Subsystems (2)
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

btrfs: tests: Fix a memory leak in error handling path in 'run_test()'

to the 4.14-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:
btrfs-tests-fix-a-memory-leak-in-error-handling-path-in-run_test.patch
and it can be found in the queue-4.14 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 foo@baz Mon Dec 18 13:28:59 CET 2017

From: Christophe JAILLET <[email protected]>
Date: Sun, 10 Sep 2017 13:19:38 +0200
Subject: btrfs: tests: Fix a memory leak in error handling path in 'run_test()'

From: Christophe JAILLET <[email protected]>

[ Upstream commit 9ca2e97fa3c3216200afe35a3b111ec51cc796d2 ]

If 'btrfs_alloc_path()' fails, we must free the resources already allocated, as done in the other error handling paths in this function.

---
 fs/btrfs/tests/free-space-tree-tests.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/btrfs/tests/free-space-tree-tests.c +2 -1
@@ -500,7 +500,8 @@ static int run_test(test_func_t test_fun
 	path = btrfs_alloc_path();
 	if (!path) {
 		test_msg("Couldn't allocate path\n");
-		return -ENOMEM;
+		ret = -ENOMEM;
+		goto out;
 	}
 
 	ret = add_block_group_free_space(&trans, root->fs_info, cache);

Patches currently in stable-queue which might be from [email protected] are

queue-4.14/video-fbdev-au1200fb-release-some-resources-if-a-memory-allocation-fails.patch queue-4.14/video-fbdev-au1200fb-return-an-error-code-if-a-memory-allocation-fails.patch queue-4.14/btrfs-tests-fix-a-memory-leak-in-error-handling-path-in-run_test.patch