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]
Message-ID: <7d926b4a-2fde-4411-9f4c-e12a9a2fcb81@sirena.org.uk>
Date: Tue, 2 Dec 2025 13:37:34 +0000
From: Mark Brown <broonie@...nel.org>
To: Shengjiu Wang <shengjiu.wang@....com>
Cc: lgirdwood@...il.com, perex@...ex.cz, tiwai@...e.com,
	andriy.shevchenko@...ux.intel.com, kuninori.morimoto.gx@...esas.com,
	nichen@...as.ac.cn, linux-sound@...r.kernel.org,
	linux-kernel@...r.kernel.org, ckeepax@...nsource.cirrus.com
Subject: Re: [PATCH 1/2] ASoC: ak4458: Disable regulator when error happens

On Tue, Dec 02, 2025 at 04:35:34PM +0800, Shengjiu Wang wrote:

> --- a/sound/soc/codecs/ak4458.c
> +++ b/sound/soc/codecs/ak4458.c
> @@ -671,7 +671,14 @@ static int ak4458_runtime_resume(struct device *dev)
>  	regcache_cache_only(ak4458->regmap, false);
>  	regcache_mark_dirty(ak4458->regmap);
>  
> -	return regcache_sync(ak4458->regmap);
> +	ret = regcache_sync(ak4458->regmap);
> +	if (ret)
> +		goto err;
> +
> +	return 0;
> +err:
> +	regulator_bulk_disable(ARRAY_SIZE(ak4458->supplies), ak4458->supplies);
> +	return ret;

While we're at it we should also put the regmap back into cache only
mode, not that the error is likely to be usefully recoverable.

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ