lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 19 Oct 2018 11:22:46 +0100
From:   Jon Hunter <jonathanh@...dia.com>
To:     Marcel Ziswiler <marcel@...wiler.com>,
        <alsa-devel@...a-project.org>, <linux-tegra@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>
CC:     Mark Brown <broonie@...nel.org>,
        Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>,
        Marcel Ziswiler <marcel.ziswiler@...adex.com>,
        Jaroslav Kysela <perex@...ex.cz>,
        Takashi Iwai <tiwai@...e.com>,
        Liam Girdwood <lgirdwood@...il.com>
Subject: Re: [PATCH v1 3/3] ASoC: soc-core: fix platform name vs. of_node
 assignement


On 18/10/2018 12:18, Marcel Ziswiler wrote:
> From: Marcel Ziswiler <marcel.ziswiler@...adex.com>
> 
> This fixes the following error as seen post commit daecf46ee0e5
> ("ASoC: soc-core: use snd_soc_dai_link_component for platform") on
> Apalis TK1 after initial probe deferral:
> 
> tegra-snd-sgtl5000 sound: ASoC: Both platform name/of_node are set for
>  sgtl5000
> tegra-snd-sgtl5000 sound: ASoC: failed to init link sgtl5000
> tegra-snd-sgtl5000 sound: snd_soc_register_card failed (-22)
> tegra-snd-sgtl5000: probe of sound failed with error -22
> 
> Signed-off-by: Marcel Ziswiler <marcel.ziswiler@...adex.com>
> 
> ---
> 
> Changes in v1:
> - Split from the Tegra series as suggested by Mark.
> - Fix issue in soc-core rather than working around it in tegra_sgtl5000.
> 
>  sound/soc/soc-core.c | 16 +++++++++++++---
>  1 file changed, 13 insertions(+), 3 deletions(-)
> 
> diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
> index 6ddcf12bc030..b97624005976 100644
> --- a/sound/soc/soc-core.c
> +++ b/sound/soc/soc-core.c
> @@ -2733,7 +2733,7 @@ static int snd_soc_bind_card(struct snd_soc_card *card)
>  int snd_soc_register_card(struct snd_soc_card *card)
>  {
>  	int i, ret;
> -	struct snd_soc_dai_link *link;
> +	struct snd_soc_dai_link *link = NULL;
>  
>  	if (!card->name || !card->dev)
>  		return -EINVAL;
> @@ -2744,7 +2744,7 @@ int snd_soc_register_card(struct snd_soc_card *card)
>  		if (ret) {
>  			dev_err(card->dev, "ASoC: failed to init link %s\n",
>  				link->name);
> -			return ret;
> +			goto err;
>  		}
>  	}
>  
> @@ -2763,7 +2763,17 @@ int snd_soc_register_card(struct snd_soc_card *card)
>  	mutex_init(&card->mutex);
>  	mutex_init(&card->dapm_mutex);
>  
> -	return snd_soc_bind_card(card);
> +	ret = snd_soc_bind_card(card);
> +	if (ret)
> +		goto err;
> +
> +	return 0;
> +
> +err:
> +	if (link && link->platform)
> +		link->platform = NULL;

Looking at snd_soc_init_platform(), it seems that the platform pointer
can be allocated by the machine driver and so if it is not allocated by
the core, then I don't think we should clear it here. Seems we need a
way to determine if this was allocated by the core.

Furthermore, it seems that it is possible that there is more than one
link that might be to be cleared.

Cheers
Jon

-- 
nvpublic

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ