Skip to contentSkip to conversation

Patch "xfs: fix two memory leaks in xfs_attr_list.c error paths" has been added to the 4.5-stable tree

PATCH [email protected] 1 participant 1 message Apr 10, 2016

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

xfs: fix two memory leaks in xfs_attr_list.c error paths

to the 4.5-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:
xfs-fix-two-memory-leaks-in-xfs_attr_list.c-error-paths.patch
and it can be found in the queue-4.5 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 2e83b79b2d6c78bf1b4aa227938a214dcbddc83f Mon Sep 17 00:00:00 2001

From: Mateusz Guzik <[email protected]>
Date: Wed, 2 Mar 2016 09:51:09 +1100
Subject: xfs: fix two memory leaks in xfs_attr_list.c error paths

From: Mateusz Guzik <[email protected]>

commit 2e83b79b2d6c78bf1b4aa227938a214dcbddc83f upstream.

This plugs 2 trivial leaks in xfs_attr_shortform_list and xfs_attr3_leaf_list_int.

---
 fs/xfs/xfs_attr_list.c |   19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)
fs/xfs/xfs_attr_list.c +10 -9
@@ -202,8 +202,10 @@ xfs_attr_shortform_list(xfs_attr_list_co
 					sbp->namelen,
 					sbp->valuelen,
 					&sbp->name[sbp->namelen]);
-		if (error)
+		if (error) {
+			kmem_free(sbuf);
 			return error;
+		}
 		if (context->seen_enough)
 			break;
 		cursor->offset++;
@@ -454,14 +456,13 @@ xfs_attr3_leaf_list_int(
 				args.rmtblkcnt = xfs_attr3_rmt_blocks(
 							args.dp->i_mount, valuelen);
 				retval = xfs_attr_rmtval_get(&args);
-				if (retval)
-					return retval;
-				retval = context->put_listent(context,
-						entry->flags,
-						name_rmt->name,
-						(int)name_rmt->namelen,
-						valuelen,
-						args.value);
+				if (!retval)
+					retval = context->put_listent(context,
+							entry->flags,
+							name_rmt->name,
+							(int)name_rmt->namelen,
+							valuelen,
+							args.value);
 				kmem_free(args.value);
 			} else {
 				retval = context->put_listent(context,

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

queue-4.5/xfs-fix-two-memory-leaks-in-xfs_attr_list.c-error-paths.patch