[alsa-devel] [PATCH 02/28] ASoC: soc-core: set component->debugfs_root NULL

Mark Brown broonie at kernel.org
Tue Aug 6 18:22:58 CEST 2019


On Tue, Aug 06, 2019 at 09:49:20AM -0500, Pierre-Louis Bossart wrote:
> >   {
> > +	if (!component->debugfs_root)
> > +		return;

> that test is redundant, it's safe to call debugfs_remove_recursive() without
> checking the argument (done internally).

It's not completely redundant...

> >   	debugfs_remove_recursive(component->debugfs_root);
> > +	component->debugfs_root = NULL;
> >   }

...with this, the two in combination add protection against a double
free.  Not 100% sure it's worth it but I queued the patch since I
couldn't strongly convince myself it's a bad idea.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20190806/9e7ded1a/attachment.sig>


More information about the Alsa-devel mailing list