Re: [PATCH] fs/affs: release memory if affs_init_bitmap fails

From: Al Viro
Date: Wed Sep 25 2019 - 18:29:48 EST


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.