From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 718143D8917; Wed, 8 Apr 2026 18:10:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775671853; cv=none; b=aIepTziWqoEfdPXI2//JwF/IzTJEWSOeDaT+Vq5RP+Zcdqv3QpwLAnOyb7w7A4b9XX/ch54LuRWJNT+rWKPNur6lJsQ92gWl8U3I+9hxcjgr0XjrbYvLZvKKaqfc7igNWvT9NIJt9ZeKyFoOBBSoDsQ6RKOoUQ08ir7nQOE/1FM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775671853; c=relaxed/simple; bh=zPXHwE3I6VmNuu+DWoHtW2MxJRUMIkAdwMEv2Rdg2Bg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Sx7STpBQBxmMzaQ1OzRv+1ntlf8UfOT+iyvTBPgCvBjR8BHcy15w3V8kjqHnou9kSkZSQWQpHnV6dVj4pWuqj1v0HcbqqPnws5rH9IXzPdM3e3+zuDssHtRu+Lwj7oJ93Zw3jcTBa02pyPHq8u7LxKMqHqlK2GLrMdW7fTYv/x8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Q2QkDt54; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Q2QkDt54" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 05D76C19421; Wed, 8 Apr 2026 18:10:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1775671853; bh=zPXHwE3I6VmNuu+DWoHtW2MxJRUMIkAdwMEv2Rdg2Bg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q2QkDt54Zy/BE6HUN3nXaZyQu1f1g2avCGiMKfE6fsK5TGmDRisIERZEJpoXeqANf NaiN9gtV1D5KXIXLzTAYfcUASWJmRbGFrQLB9HvKc3thVPKTsvZKlqn8OkgrjO5G/h E8ZR98XAiAYQ/8U23aMl+zdXD7Hs/iN1nS53DoQM= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jihed Chaibi , =?UTF-8?q?Nuno=20S=C3=A1?= , Mark Brown , Sasha Levin Subject: [PATCH 6.1 086/312] ASoC: adau1372: Fix unchecked clk_prepare_enable() return value Date: Wed, 8 Apr 2026 20:00:03 +0200 Message-ID: <20260408175936.958471243@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260408175933.715315542@linuxfoundation.org> References: <20260408175933.715315542@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jihed Chaibi [ Upstream commit 326fe8104a4020d30080d37ac8b6b43893cdebca ] adau1372_set_power() calls clk_prepare_enable() but discards the return value. If the clock enable fails, the driver proceeds to access registers on unpowered hardware, potentially causing silent corruption. Make adau1372_set_power() return int and propagate the error from clk_prepare_enable(). Update adau1372_set_bias_level() to return the error directly for the STANDBY and OFF cases. Signed-off-by: Jihed Chaibi Fixes: 6cd4c6459e47 ("ASoC: Add ADAU1372 audio CODEC support") Reviewed-by: Nuno Sá Link: https://patch.msgid.link/20260325210704.76847-2-jihed.chaibi.dev@gmail.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/adau1372.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/sound/soc/codecs/adau1372.c b/sound/soc/codecs/adau1372.c index a9f89e8565ec6..79446c4458cc6 100644 --- a/sound/soc/codecs/adau1372.c +++ b/sound/soc/codecs/adau1372.c @@ -781,15 +781,18 @@ static void adau1372_enable_pll(struct adau1372 *adau1372) dev_err(adau1372->dev, "Failed to lock PLL\n"); } -static void adau1372_set_power(struct adau1372 *adau1372, bool enable) +static int adau1372_set_power(struct adau1372 *adau1372, bool enable) { if (adau1372->enabled == enable) - return; + return 0; if (enable) { unsigned int clk_ctrl = ADAU1372_CLK_CTRL_MCLK_EN; + int ret; - clk_prepare_enable(adau1372->mclk); + ret = clk_prepare_enable(adau1372->mclk); + if (ret) + return ret; if (adau1372->pd_gpio) gpiod_set_value(adau1372->pd_gpio, 0); @@ -828,6 +831,8 @@ static void adau1372_set_power(struct adau1372 *adau1372, bool enable) } adau1372->enabled = enable; + + return 0; } static int adau1372_set_bias_level(struct snd_soc_component *component, @@ -841,11 +846,9 @@ static int adau1372_set_bias_level(struct snd_soc_component *component, case SND_SOC_BIAS_PREPARE: break; case SND_SOC_BIAS_STANDBY: - adau1372_set_power(adau1372, true); - break; + return adau1372_set_power(adau1372, true); case SND_SOC_BIAS_OFF: - adau1372_set_power(adau1372, false); - break; + return adau1372_set_power(adau1372, false); } return 0; -- 2.53.0