Re: [PATCH 09/13] ASoC: soc-core: use devm_kzalloc() for rtd

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Sridharan

Thank you for your review

>     --- a/sound/soc/soc-core.c
>     +++ b/sound/soc/soc-core.c
>     @@ -370,11 +370,8 @@ static void soc_free_pcm_runtime(struct snd_soc_pcm_runtime *rtd)
>             if (!rtd)
>                     return;
>    
>     -       kfree(rtd->codec_dais);
>     -       if (rtd->dev)
>     -               device_unregister(rtd->dev); /* soc_release_rtd_dev */
>             list_del(&rtd->list);
>     -       kfree(rtd);
> 
> Morimoto-san,
> 
> Just curious, why did you remove the check for if(rtd->dev) here before calling device_unregister()?
> 
> Thanks,
> Ranjani 
> 
>     +       device_unregister(rtd->dev); /* soc_release_rtd_dev */
>      }

Can you check [07/13] patch ?
It allocs rtd->dev (as dev) first, and allocs rtd next.
This means, if it has rtd, it has rtd->dev.

Here, this function checks rtd pointer.
If rtd is not NULL, rtd->dev is also not NULL.

But, indeed it is a littile bit tricky ?
Some comment is needed.

Thank you for your help !!
Best regards
---
Kuninori Morimoto
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux