[PATCH] xfs: fix memory leak in xlog_recover_add_to_trans

Mark Tinguely tinguely at sgi.com
Tue Oct 1 08:20:56 CDT 2013


On 09/30/13 17:53, Ben Myers wrote:
> On Fri, Sep 27, 2013 at 09:00:55AM -0500, tinguely at 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 at 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.



More information about the xfs mailing list