[Top] [All Lists]

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

To: Ben Myers <bpm@xxxxxxx>
Subject: Re: [PATCH] xfs: fix memory leak in xlog_recover_add_to_trans
From: Mark Tinguely <tinguely@xxxxxxx>
Date: Tue, 01 Oct 2013 08:20:56 -0500
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <20130930225306.GS1935@xxxxxxx>
References: <20130927140104.515578025@xxxxxxx> <20130930225306.GS1935@xxxxxxx>
User-agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20120122 Thunderbird/9.0
On 09/30/13 17:53, Ben Myers wrote:
On Fri, Sep 27, 2013 at 09:00:55AM -0500, tinguely@xxxxxxx 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@xxxxxxx>


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",
+                       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.


<Prev in Thread] Current Thread [Next in Thread>
  • Re: [PATCH] xfs: fix memory leak in xlog_recover_add_to_trans, Mark Tinguely <=