[alsa-devel] [RFC PATCH 1/3] ASoC: core: do not unload topology in unregister_component()

Ranjani Sridharan ranjani.sridharan at linux.intel.com
Fri Apr 5 04:23:54 CEST 2019


On Fri, 2019-04-05 at 09:17 +0700, Mark Brown wrote:
> On Thu, Apr 04, 2019 at 05:30:38PM -0700, Ranjani Sridharan wrote:
> > Typically, topology is loaded when the card is registered
> > by the machine driver and the link components are probed.
> > Therefore, it should be unloaded when the link components
> > are removed. This will make the register/unregister component
> > methods balanced.
> >  			continue;
> >  
> > -		snd_soc_tplg_component_remove(component,
> > -					      SND_SOC_TPLG_INDEX_ALL);
> >  		snd_soc_component_del_unlocked(component);
> >  		found = 1;
> 
> Isn't this a robustness fix?  It's just freeing anything that's left
> over, it doesn't free specific stuff and shouldn't stop anything else
> freeing that before so if we made a mistake earlier on it'll clean up
> after you.
Hi Mark,

Agree that this might make the clean up robust. But today we call this
only when the component is unregistered and that's causing a null
pointer dereference. So what we really need to do is to remove the
topology in remove() first. 

Thanks,
Ranjani 

> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel at alsa-project.org
> https://mailman.alsa-project.org/mailman/listinfo/alsa-devel



More information about the Alsa-devel mailing list