linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fs/ext3: set pointer = NULL, after kfree it
@ 2012-12-24  5:58 Chen Gang
  2012-12-25 18:51 ` Theodore Ts'o
  0 siblings, 1 reply; 4+ messages in thread
From: Chen Gang @ 2012-12-24  5:58 UTC (permalink / raw)
  To: jack, akpm; +Cc: linux-ext4


  set s->base = NULL, after kfree it.

Signed-off-by: Chen Gang <gang.chen@asianux.com>
---
 fs/ext3/xattr.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/ext3/xattr.c b/fs/ext3/xattr.c
index d22ebb7..57aab94 100644
--- a/fs/ext3/xattr.c
+++ b/fs/ext3/xattr.c
@@ -847,8 +847,10 @@ cleanup:
 	if (ce)
 		mb_cache_entry_release(ce);
 	brelse(new_bh);
-	if (!(bs->bh && s->base == bs->bh->b_data))
+	if (!(bs->bh && s->base == bs->bh->b_data)) {
 		kfree(s->base);
+		s->base = NULL;
+	}
 
 	return error;
 
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-12-31 15:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-24  5:58 [PATCH] fs/ext3: set pointer = NULL, after kfree it Chen Gang
2012-12-25 18:51 ` Theodore Ts'o
2012-12-26  2:33   ` Chen Gang
2012-12-31 15:19     ` Jan Kara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).