public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Andrew Morton <akpm@linux-foundation.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/5] fs: efs: fix possible memory leak
Date: Wed, 18 Feb 2015 19:26:19 +0530	[thread overview]
Message-ID: <20150218135619.GA10604@sudip-PC> (raw)
In-Reply-To: <20150217193101.GA11847@ZenIV.linux.org.uk>

On Tue, Feb 17, 2015 at 07:31:01PM +0000, Al Viro wrote:
> On Thu, Feb 12, 2015 at 02:32:21PM +0530, Sudip Mukherjee wrote:
> 
> The hell we are not - unlike ->put_super(), ->kill_sb() is *always*
> called, even when fill_super() fails halfway through.  Exactly because
> it makes for simpler cleanup requirements on failure exits in said
> fill_super().  And we have
> static void efs_kill_sb(struct super_block *s)
> {
>         struct efs_sb_info *sbi = SUPER_INFO(s);
>         kill_block_super(s);
>         kfree(sbi);
> }
> for ->kill_sb() there, so sbi will *not* leak.
thanks for explaining this. I was seeing the code in the fat and was trying to figure out why this in efs was not released.
i was have one more doubt about efs_iget() but that also is actually cleared with this.

thanks
sudip

> 
> NAK.  This patch not only complicates efs_fill_super() for no good reason,
> it ends up with double kfree() on those failure exits - ->s_fs_info is
> left pointing to freed memory and efs_kill_sb() does kfree() again.

  reply	other threads:[~2015-02-18 13:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-12  9:02 [PATCH 1/5] fs: efs: fix trailing and leading space Sudip Mukherjee
2015-02-12  9:02 ` [PATCH 2/5] fs: efs: fix forward declarations Sudip Mukherjee
2015-02-12  9:02 ` [PATCH 3/5] fs: efs: remove nonexistant site Sudip Mukherjee
2015-02-12  9:02 ` [PATCH 4/5] fs: efs: fix possible memory leak Sudip Mukherjee
2015-02-17 19:31   ` Al Viro
2015-02-18 13:56     ` Sudip Mukherjee [this message]
2015-02-12  9:02 ` [PATCH 5/5] MAINTAINERS: remove website Sudip Mukherjee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150218135619.GA10604@sudip-PC \
    --to=sudipm.mukherjee@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@ZenIV.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox