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] [day] [month] [year] [list]
Date:   Thu, 3 Mar 2022 13:38:34 +0000
From:   Charles Keepax <ckeepax@...nsource.cirrus.com>
To:     Jiasheng Jiang <jiasheng@...as.ac.cn>
CC:     <lgirdwood@...il.com>, <broonie@...nel.org>, <perex@...ex.cz>,
        <tiwai@...e.com>, <patches@...nsource.cirrus.com>,
        <alsa-devel@...a-project.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] ASoC: wm8350: Handle error for wm8350_register_irq

On Thu, Mar 03, 2022 at 04:21:54PM +0800, Jiasheng Jiang wrote:
> As the potential failure of the wm8350_register_irq(),
> it should be better to check it and return error if fails.
> Also, use 'free_' in order to avoid the same code.
> 
> Fixes: a6ba2b2dabb5 ("ASoC: Implement WM8350 headphone jack detection")
> Signed-off-by: Jiasheng Jiang <jiasheng@...as.ac.cn>
> ---
>  sound/soc/codecs/wm8350.c | 30 +++++++++++++++++++++++++-----
>  1 file changed, 25 insertions(+), 5 deletions(-)
> 
> diff --git a/sound/soc/codecs/wm8350.c b/sound/soc/codecs/wm8350.c
> index 15d42ce3b21d..0c70bbfbedb5 100644
> --- a/sound/soc/codecs/wm8350.c
> +++ b/sound/soc/codecs/wm8350.c
> @@ -1483,7 +1483,7 @@ static  int wm8350_component_probe(struct snd_soc_component *component)
>  	ret = devm_regulator_bulk_get(wm8350->dev, ARRAY_SIZE(priv->supplies),
>  				 priv->supplies);
>  	if (ret != 0)
> -		return ret;
> +		goto err;

I would probably just leave this as a return, nothing is gained
changing it to a goto.

>  
> +	ret = wm8350_register_irq(wm8350, WM8350_IRQ_CODEC_JCK_DET_R,
>  			    wm8350_hpr_jack_handler, 0, "Right jack detect",
>  			    priv);
> -	wm8350_register_irq(wm8350, WM8350_IRQ_CODEC_MICSCD,
> +	if (ret != 0)
> +		goto free_JCK_DET_L;

Probably better to use non-caps here, having caps in a label is a
little unusual.

Otherwise I think this looks fine.

Thanks,
Charles

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ