[alsa-devel] [PATCH v2 02/23] ASoC: tas2552: Fix kernel crash when the codec is loaded but not part of a card

Mark Brown broonie at kernel.org
Thu Jun 4 18:25:27 CEST 2015


On Thu, Jun 04, 2015 at 04:04:14PM +0300, Peter Ujfalusi wrote:
> If the card is not part of any card the tas_data->codec is NULL since it is
> set only during snd_soc_codec_driver.probe, which is not yet called.

> @@ -120,6 +120,9 @@ static void tas2552_sw_shutdown(struct tas2552_data *tas_data, int sw_shutdown)
>  {
>  	u8 cfg1_reg;
>  
> +	if (!tas_data->codec)
> +		return;
> +

This fixes the crash but isn't whatever the function is doing important
(so we should fix by using regmap for the I/O or something)?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20150604/9c684434/attachment.sig>


More information about the Alsa-devel mailing list