[alsa-devel] [bug report] ASoC: snd_soc_component_driver has snd_compr_ops

Kuninori Morimoto kuninori.morimoto.gx at renesas.com
Wed Jan 17 01:26:56 CET 2018


Hi Dan

Thank you for your report

> >     93  machine_err:
> >     94          for_each_rtdcom(rtd, rtdcom) {
> >     95                  component = rtdcom->component;
> >     96  
> >     97                  /* ignore duplication for now */
> >     98                  if (platform && (component == &platform->component))
> >     99                          continue;
> >    100  
> >    101                  if (!component->driver->compr_ops ||
> >    102                      !component->driver->compr_ops->free)
> >    103                          continue;
> >    104  
> >    105                  component->driver->compr_ops->free(cstream);
> >                                                     ^^^^^^^^^^^^^^^
> > This is in a loop so is the really right?  We end up freeing cstream
> > over and over?
> > 
> >    106          }
> >    107  
> >    108          if (platform && platform->driver->compr_ops && platform->driver->compr_ops->free)
> >    109                  platform->driver->compr_ops->free(cstream);
> >                                                     ^^^^^^^^^^^^^

In for_each_rtdcom(), it is checking and avoiding duplicate operation by

	/* ignore duplication for now */
	if (platform && (component == &platform->component))
		continue;

So, I think there is no double free ?

Best regards
---
Kuninori Morimoto


More information about the Alsa-devel mailing list