From: Al Viro <viro@zeniv.linux.org.uk>
To: dsterba@suse.cz, Navid Emamdoost <navid.emamdoost@gmail.com>,
David Sterba <dsterba@suse.com>,
emamd001@umn.edu, kjlu@umn.edu, smccaman@umn.edu,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fs/affs: release memory if affs_init_bitmap fails
Date: Wed, 25 Sep 2019 23:29:42 +0100 [thread overview]
Message-ID: <20190925222942.GP26530@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20190917095241.GP2850@suse.cz>
On Tue, Sep 17, 2019 at 11:52:41AM +0200, David Sterba wrote:
> On Mon, Sep 16, 2019 at 11:13:42PM -0500, Navid Emamdoost wrote:
> > In affs_init_bitmap, on error handling path we may release the allocated
> > memory.
>
> Yes the memory should be released but not all paths that lead to the
> label 'out' are actually errors:
... and none of them should be freeing anything here, errors or no
errors.
> The sbi->s_bitmap would be freed but at umount time it will
> be freed again.
It actually would be freed by superblock destructor, be it on umount
or on failed fill_super.
prev parent reply other threads:[~2019-09-25 22:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-17 4:13 [PATCH] fs/affs: release memory if affs_init_bitmap fails Navid Emamdoost
2019-09-17 9:52 ` David Sterba
2019-09-25 22:29 ` Al Viro [this message]
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=20190925222942.GP26530@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=dsterba@suse.com \
--cc=dsterba@suse.cz \
--cc=emamd001@umn.edu \
--cc=kjlu@umn.edu \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=navid.emamdoost@gmail.com \
--cc=smccaman@umn.edu \
/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;
as well as URLs for NNTP newsgroup(s).