Re: [PATCH 0/6] ASoC: use devm_snd_soc_register_card()

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



On Wed, 10 Jan 2024 02:27:39 +0100,
Kuninori Morimoto wrote:
> 
> 
> Hi Mark
> 
> We can use devm_snd_soc_register_card()
> instead of      snd_soc_register_card(),  and is possible
> to ignore       snd_soc_unregister_card().

I haven't looked through all code changes, but in general, be careful
when the driver is releasing something else than the devres-managed
stuff.  Namely, the devres stuff is released *after* the call of
remove callback.

For example, in your patch for cirrus driver:

 static void edb93xx_remove(struct platform_device *pdev)
 {
-	struct snd_soc_card *card = platform_get_drvdata(pdev);
-
-	snd_soc_unregister_card(card);
 	ep93xx_i2s_release();
 }
 
This will end up with different call orders of soc-unregister and
ep93xx_i2s_release().  This kind of changes may easily be a hidden
source of UAF.


Takashi




[Index of Archives]     [Pulseaudio]     [Linux Audio Users]     [ALSA Devel]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux