Re: [PATCH] xfs: fix memory leak in xlog_recover_add_to_trans

Mark Tinguely
2013-10-01T13:21:02Z

On 09/30/13 17:53, Ben Myers wrote:
> On Fri, Sep 27, 2013 at 09:00:55AM -0500, tinguely@sgi.com wrote:
>> Free the memory in error path of xlog_recover_add_to_trans().
>> Normally this memory is freed in recovery pass2, but is leaked
>> in the error path.
>>
>> Signed-off-by: Mark Tinguely<tinguely@sgi.com>
>
> Applied.

Index: b/fs/xfs/xfs_log_recover.c
===================================================================
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -1585,6 +1585,7 @@ xlog_recover_add_to_trans(
"bad number of regions (%d) in inode log format",
in_f->ilf_size);
ASSERT(0);
+ free(ptr);

Sigh. I am a big fat, dunce-hatted, dork. This is the xfsprogs patch.
The kernel needs kmem_free().

Please pull the patch. I will redo the whole thing to also make sure the
list is removed on error.

--Mark.