From patchwork Mon Dec 24 05:58:14 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: fs/ext3: set pointer = NULL, after kfree it Date: Sun, 23 Dec 2012 19:58:14 -0000 From: Chen Gang X-Patchwork-Id: 208028 Message-Id: <50D7EEF6.4070005@asianux.com> To: jack@suse.cz, akpm@linux-foundation.org Cc: linux-ext4@vger.kernel.org set s->base = NULL, after kfree it. Signed-off-by: Chen Gang --- 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;