From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 B8B261A681E; Fri, 7 Aug 2026 15:17:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786115827; cv=none; b=ZPby51lgj0K6ul/vh7vq/ZPc4j11Hrr8E1wTeI/zyG7HSU9nJ0YdU1nRftO/uYp/qibseMcFij+4wAp8zQVrwweJHFTBMdjz2uoM41MHTUwDDTmH6U+0a1IAO0PCyDqty5INM53mdmH5oNJOPeZMNASaJBs+9vxDA30u9gEZBTQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786115827; c=relaxed/simple; bh=5J/qzWOf3FD4znrY6wjK+9tjvUgEKauPeluWzc6Kv/w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dT59/HH3NvyBof8TGTeSA+E+ef2YoaVy1VrmdwFWCwEYCy+2qmNfPWZpuE36i82Do+N12b/2VgFsGwa0HIbm/fte0cF+PrH3ihiBqyPC2epqBV4jbHaMNnqi/obcAUl/rX1T3+ze52QDUl8AMS/hsqJnmsx09u2BcwhBjVPI3yw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=tPl3QKFq; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="tPl3QKFq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 20E371F000E9; Fri, 7 Aug 2026 15:17:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1786115826; bh=wW0ZDYJlTDpuaM3I7xARN4pKr3Kz2GSIQW9woLkYCwg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=tPl3QKFqfezG5qS5HOaBoLFDUmt2hMzN/geyN1Wid+FBrp2y+ebcBvgHmj/UC3hhO AuM6gfQKc6UykUeQUzXtqMk2viZqPpxoTMkSweQHMjGMI4TSRh51J5/EAcIUR3l+rN ifPOiDIvEjCXNJbqAcipqDtaTCS+JUuKHkKOjLlo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Uday Khare , Mark Brown , Sasha Levin Subject: [PATCH 6.6 017/261] ASoC: max98095: fix missing IS_ERR() before PTR_ERR() on mclk lookup Date: Fri, 7 Aug 2026 16:36:14 +0200 Message-ID: <20260807143415.740927587@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260807143415.358597922@linuxfoundation.org> References: <20260807143415.358597922@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Uday Khare [ Upstream commit 317e21532e6ffa1de026bdbce5ba98e1b70ca5c6 ] In max98095_probe(), the -EPROBE_DEFER check after devm_clk_get() is broken due to a missing IS_ERR() guard. The code intends to return -EPROBE_DEFER only when the clock lookup fails with that specific error. However, without IS_ERR() the check: if (PTR_ERR(max98095->mclk) == -EPROBE_DEFER) is called unconditionally, including when devm_clk_get() succeeds and returns a valid pointer. Calling PTR_ERR() on a valid pointer reinterprets its address as a signed long; the result is arbitrary and is almost never equal to -EPROBE_DEFER, so the check silently does nothing in the success case. When devm_clk_get() fails with any error other than -EPROBE_DEFER the check is also skipped, leaving max98095->mclk holding an error pointer with no indication to the caller. This means a deferred probe will never actually be triggered for this device, and any non-EPROBE_DEFER clock error is silently swallowed with the error pointer left in the mclk field. Fix this by adding the missing IS_ERR() guard around the PTR_ERR() call, matching the pattern already used in the sibling max98088 and wm8960 drivers. Fixes: e3048c3d2be5 ("ASoC: max98095: Add master clock handling") Signed-off-by: Uday Khare Link: https://patch.msgid.link/20260720103950.14474-1-udaykhare77@gmail.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/max98095.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/max98095.c b/sound/soc/codecs/max98095.c index 7e525d49328d2..3b37f4c4235e6 100644 --- a/sound/soc/codecs/max98095.c +++ b/sound/soc/codecs/max98095.c @@ -1984,8 +1984,9 @@ static int max98095_probe(struct snd_soc_component *component) int ret = 0; max98095->mclk = devm_clk_get(component->dev, "mclk"); - if (PTR_ERR(max98095->mclk) == -EPROBE_DEFER) - return -EPROBE_DEFER; + if (IS_ERR(max98095->mclk)) + if (PTR_ERR(max98095->mclk) == -EPROBE_DEFER) + return -EPROBE_DEFER; /* reset the codec, the DSP core, and disable all interrupts */ max98095_reset(component); -- 2.53.0