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 8B9643907D3; Sat, 28 Feb 2026 17:36:55 +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=1772300215; cv=none; b=Lb/ibxQGIUx6JguLcpFlKoy06CryObpAdHIo6lVenRW4oux8kJlqP5oTyZSGOlrA3n4pa8Mo8D3qiaAXXz6N1J3GTsaGu6//YMLJEZpPHnFZdgiJtwJJGMtWqaH1yep/ayABmohvNDxGcPUUA3U7DNrtW6AzKvaG+doh3F6uvX0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772300215; c=relaxed/simple; bh=YZAeivByqG0CxOjlVDNH88qy95Dk6/eIfkugnyP5LoI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=libv/HecNQKWSkClpFkS7Bo9tGilVv/Kny2f3zW11dXqs7TuqrTg2RXhN/6LvQFhvF2TOdmecyiGTbPffIKm0TB7xeNfJ/8itF8IQYepxc15j8v7OoSUJL7DMk2SflG+e74fhi6drhFvWp0E804KbHKOLqEGpbMiKayHElOe2YI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Lz+EG5Hw; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Lz+EG5Hw" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D88B2C19425; Sat, 28 Feb 2026 17:36:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772300215; bh=YZAeivByqG0CxOjlVDNH88qy95Dk6/eIfkugnyP5LoI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Lz+EG5HwTnLdsyNbt98FYMfZ5p8cRRvNV84CZ1uCElRQCkFEGYuBznFwfYb3PZDjB CJ/EA6rr6yii+G6dbRVMFAN1kd6EtowS7nooYCmYkAOtjs0LUWKYQ+BIHVkE40GxVl 1S7pSVfNUEzSM9eQFbuPTtdIBURri3FnI1paICsnj5oSemxEy0nl32AAU5zACBVocV bRQxVNfqLCDGff2FvMZRGexdGsxoTShZjv5Pk3+7a2QABS+jy9boD570saTFCLzTu0 H3bh1YsrZiuW6iJ7RDROMEniAULB5qZ3Az5nVgUp9Chdg4FjGYVR5jiL5GifKoIpE5 PMKH2mvk1zlzA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Hsieh Hung-En , Mark Brown , Sasha Levin Subject: [PATCH 6.19 235/844] ASoC: es8328: Add error unwind in resume Date: Sat, 28 Feb 2026 12:22:28 -0500 Message-ID: <20260228173244.1509663-236-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260228173244.1509663-1-sashal@kernel.org> References: <20260228173244.1509663-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Hsieh Hung-En [ Upstream commit 8232e6079ae6f8d3a61d87973cb427385aa469b9 ] Handle failures in the resume path by unwinding previously enabled resources. If enabling regulators or syncing the regcache fails, disable regulators and unprepare the clock to avoid leaking resources and leaving the device in a partially resumed state. Signed-off-by: Hsieh Hung-En Link: https://patch.msgid.link/20260130160017.2630-6-hungen3108@gmail.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/es8328.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/es8328.c b/sound/soc/codecs/es8328.c index 1e11175cfbbbf..47c6b0c218b2c 100644 --- a/sound/soc/codecs/es8328.c +++ b/sound/soc/codecs/es8328.c @@ -758,17 +758,23 @@ static int es8328_resume(struct snd_soc_component *component) es8328->supplies); if (ret) { dev_err(component->dev, "unable to enable regulators\n"); - return ret; + goto err_clk; } regcache_mark_dirty(regmap); ret = regcache_sync(regmap); if (ret) { dev_err(component->dev, "unable to sync regcache\n"); - return ret; + goto err_regulators; } return 0; + +err_regulators: + regulator_bulk_disable(ARRAY_SIZE(es8328->supplies), es8328->supplies); +err_clk: + clk_disable_unprepare(es8328->clk); + return ret; } static int es8328_component_probe(struct snd_soc_component *component) -- 2.51.0