From nobody Wed Jun 17 03:56:42 2026 Received: from cse.ust.hk (cssvr7.cse.ust.hk [143.89.41.157]) (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 9D50C31F983; Tue, 28 Apr 2026 08:02:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=143.89.41.157 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777363337; cv=pass; b=lGIDJ6K0H2+zjNnCSjIio6vtkX68yQOX9P576ublcfSLHV1/CBPz5D7xYQi1tR6OeGS/6DY7dHccbSYCNQVab0a6Yq4Er52pUP+4sLOtVumU5DkriEUNjlWoK0CyBzktIXKx8dFIVhJR1z3tWK1jnub7JzicyPFbBv0Wwn9WIn0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777363337; c=relaxed/simple; bh=S4OK4VJXIp+ahOJ0u5h6kGrmq5MpZTmwflllWODfUmU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=fHbifklaq15MkX+k4PNkNfXJWypqRN4aZWIxFuDU9k50WEASRcetou/lI4SuHEB8O7z8mmFtRlaldPRp74Q+q2DyQ7J4xCM37kROgHON6gerzQuOu1rv3+L6X4piCT+kE4AD+eAvP+KAaZdg1VTAyFV1b89wQda57W5c6LlwB+0= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cse.ust.hk; spf=pass smtp.mailfrom=cse.ust.hk; dkim=pass (1024-bit key) header.d=cse.ust.hk header.i=@cse.ust.hk header.b=29JuEtIH; arc=pass smtp.client-ip=143.89.41.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cse.ust.hk Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cse.ust.hk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=cse.ust.hk header.i=@cse.ust.hk header.b="29JuEtIH" ARC-Seal: i=1; d=cse.ust.hk; s=arccse; a=rsa-sha256; cv=none; t=1777363311; b=tdzS0f11clOe/0WxeBMZp1DAIqZMjKAzsxerDecRntp8/aj6BStbvv7qO5WqOazY81SM u/dORc/i0FLMMUjo08JNRRwbYbGu6DmbxFikk0/7z3PQh/5UCi6s87udUA629SVg7Je5u 950hyFii5gqxihDMGVGptGxl66CqqcuM3A= ARC-Message-Signature: i=1; d=cse.ust.hk; s=arccse; a=rsa-sha256; c=relaxed/relaxed; t=1777363311; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; bh=dxpV12JY3UaIwaqnfCAHvl4Z3rUyodEpctJOMdNdIPU=; b=uYOqjcM8pUl33LrdT1ZmYAx+x7cDPHg8qD0BzkZisMeKcPzM0tpk4TibZJlTlEIfhf/V 6H5CCiHr0QRZJOlBXCAj12a+52hCSoaB7PKl/ius5LNTr+znjlyCOBlZiQ9xpS+OiTnmB U/EcWh7tI70SO4AJB07kFHr2ARNZszBhr8= ARC-Authentication-Results: i=1; cse.ust.hk; arc=none smtp.remote-ip=143.89.191.45 Received: from chcpu16 (191host045.mobilenet.cse.ust.hk [143.89.191.45]) (authenticated bits=0) by cse.ust.hk (8.18.1/8.12.5) with ESMTPSA id 63S81i0D3244876 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 28 Apr 2026 16:01:49 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cse.ust.hk; s=cseusthk; t=1777363311; bh=dxpV12JY3UaIwaqnfCAHvl4Z3rUyodEpctJOMdNdIPU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=29JuEtIHdp+ZgXRN6Ewicv5u4THnjZG/ctt7nvhYTtFyMwyni2Oes2al3u8A5KvTD M9oUS9yAGg4J8lBhBIZMHYsT0abkoI0vMS/PDoLiiYuzMCaMssAigVzdNa/3RHnTtn rGeF5Wt6uYl5DNqij7QYu1lOHaNJHA1ix3Qj653o= Date: Tue, 28 Apr 2026 16:01:39 +0800 From: Shuhao Fu To: David Rhodes , Richard Fitzgerald Cc: Jaroslav Kysela , Takashi Iwai , linux-sound@vger.kernel.org, patches@opensource.cirrus.com, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] ALSA: hda: cs35l56: Put ACPI device after setting companion Message-ID: <20260428080139.GA1649104@chcpu16> References: <20260428074415.GA1632446@chcpu16> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20260428074415.GA1632446@chcpu16> X-Env-From: sfual Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" acpi_dev_get_first_match_dev() returns a refcounted ACPI device and callers are expected to balance it with acpi_dev_put(). When no companion is already attached, cs35l56_hda_read_acpi() looks up an ACPI device and sets it with ACPI_COMPANION_SET(), but leaves the lookup reference held. ACPI_COMPANION_SET() does not take ownership of that reference, so drop it with acpi_dev_put() after attaching the companion. Fixes: 73cfbfa9caea ("ALSA: hda/cs35l56: Add driver for Cirrus Logic CS35L5= 6 amplifier") Signed-off-by: Shuhao Fu Tested-by: Simon Trimmer --- sound/hda/codecs/side-codecs/cs35l56_hda.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/hda/codecs/side-codecs/cs35l56_hda.c b/sound/hda/codecs/= side-codecs/cs35l56_hda.c index 1ace4beef50857b..16a5a40899b2873 100644 --- a/sound/hda/codecs/side-codecs/cs35l56_hda.c +++ b/sound/hda/codecs/side-codecs/cs35l56_hda.c @@ -1032,6 +1032,7 @@ static int cs35l56_hda_read_acpi(struct cs35l56_hda *= cs35l56, int hid, int id) return -ENODEV; } ACPI_COMPANION_SET(cs35l56->base.dev, adev); + acpi_dev_put(adev); } =20 /* Initialize things that could be overwritten by a fixup */ From nobody Wed Jun 17 03:56:42 2026 Received: from cse.ust.hk (cssvr7.cse.ust.hk [143.89.41.157]) (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 DA89A2836A6; Tue, 28 Apr 2026 08:13:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=143.89.41.157 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777363984; cv=pass; b=eSeqFZJZwzvX9iL9DtiuV6Glqx7xX+XlEf6jNoeEI1Qx53roLfLrNTzI6j8L+O6Z9ykWkV1tAMwOGvrHB5gljhc8bQynKjHdsLymz9sUMz2V0sWXmnYNIh1oM7h6nPeD6At5Tdc9VvjDHbyVxD7to4x2TYg99jEx0UKtNaJ3sD8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777363984; c=relaxed/simple; bh=Ryc6BmtXeysPqdJoSHYeJgTaKXRn0FLhOlvkHIeVXEw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=V8sj/U+Npwj7cyAaGO/2ja6o/o4yE4jTnlCwU5K2YDa/r76ElYBD/xwtoQbaS1TiuRim4i6LlVcdqL6FmBr84/q9eyOCPtPjkXKmni043oQelLKYmckuPYUA/NQD+LOmPmWECscmvfPCnieLpWloOq6OEyfbsCGJO4yyDX1eKto= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cse.ust.hk; spf=pass smtp.mailfrom=cse.ust.hk; dkim=pass (1024-bit key) header.d=cse.ust.hk header.i=@cse.ust.hk header.b=N3y1ixkx; arc=pass smtp.client-ip=143.89.41.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cse.ust.hk Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cse.ust.hk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=cse.ust.hk header.i=@cse.ust.hk header.b="N3y1ixkx" ARC-Seal: i=1; d=cse.ust.hk; s=arccse; a=rsa-sha256; cv=none; t=1777363969; b=BQAlDLAPcTFPtBCTr5rnAXsKmmB7SW+lnMKX/4BjUs1VyBDOXqLKxAmRL0TE87BLiOXM GrU2p2j6TMqegO4veOl1g6ziHZkcW3cssxoxYydV8Shrs7nIWRiQwxjnYrUtXSKEiINuI f1Pz2Z9+Pw6QHt4JMdaOre3NnGTeI+8FYs= ARC-Message-Signature: i=1; d=cse.ust.hk; s=arccse; a=rsa-sha256; c=relaxed/relaxed; t=1777363969; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; bh=4NxXpz8067DANuHCjerb6xBOiqKndzCOUE0ckvQf60c=; b=Jo9ODmek56vx7+lDwewIWrqGxBFIpwiaaVqSA38Oib/cX1eKAqiofMt8MTGeObo1G1Q+ lpSlF/UwofCNRcvGBMClF+mnrcwGcVhNTXvHRXPkMY1FHEsYf+5u/t4d0B48OR0JUgbFC kWTrNAq9CY65suRd12Eo7KX3LT8iNYu4Uc= ARC-Authentication-Results: i=1; cse.ust.hk; arc=none smtp.remote-ip=143.89.191.45 Received: from chcpu16 (191host045.mobilenet.cse.ust.hk [143.89.191.45]) (authenticated bits=0) by cse.ust.hk (8.18.1/8.12.5) with ESMTPSA id 63S8Ch9x3248923 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 28 Apr 2026 16:12:48 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cse.ust.hk; s=cseusthk; t=1777363969; bh=4NxXpz8067DANuHCjerb6xBOiqKndzCOUE0ckvQf60c=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=N3y1ixkxAmlEjzxsfaXFaGigj2KL8GwYE0NUiVcfPqVaUgaHEjYfW22Ylk2+dSVRD Xyq6Ptf9K4B0wZOzdTiOQcy/dqRSyjEQ+cmpXbkhFZEM8wW0z2dzy6jkeSTOYBYSot /fhFtbNWFOGEBV2Pz28EDHYPrrlS6V8MCIkDkC6Y= Date: Tue, 28 Apr 2026 16:12:38 +0800 From: Shuhao Fu To: David Rhodes , Richard Fitzgerald Cc: Jaroslav Kysela , Takashi Iwai , linux-sound@vger.kernel.org, patches@opensource.cirrus.com, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] ALSA: hda: cs35l41: Put ACPI device on missing physical node Message-ID: <20260428081238.GA1659932@chcpu16> References: <20260428074415.GA1632446@chcpu16> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20260428074415.GA1632446@chcpu16> X-Env-From: sfual Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" acpi_dev_get_first_match_dev() returns a refcounted ACPI device and callers must balance it with acpi_dev_put(). cs35l41_hda_read_acpi() stores the returned ACPI device in cs35l41->dacpi. That reference is normally released by the later probe cleanup or the remove path, but the NULL-check on physdev exits before either of those paths can run. Drop the lookup reference before returning -ENODEV. Fixes: c34b04cc6178 ("ALSA: hda: cs35l41: Fix NULL pointer dereference in c= s35l41_hda_read_acpi()") Signed-off-by: Shuhao Fu Tested-by: Simon Trimmer --- sound/hda/codecs/side-codecs/cs35l41_hda.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sound/hda/codecs/side-codecs/cs35l41_hda.c b/sound/hda/codecs/= side-codecs/cs35l41_hda.c index b64890006bb7019..acfccc848f82d82 100644 --- a/sound/hda/codecs/side-codecs/cs35l41_hda.c +++ b/sound/hda/codecs/side-codecs/cs35l41_hda.c @@ -1896,8 +1896,10 @@ static int cs35l41_hda_read_acpi(struct cs35l41_hda = *cs35l41, const char *hid, i =20 cs35l41->dacpi =3D adev; physdev =3D get_device(acpi_get_first_physical_node(adev)); - if (!physdev) + if (!physdev) { + acpi_dev_put(adev); return -ENODEV; + } =20 sub =3D acpi_get_subsystem_id(ACPI_HANDLE(physdev)); if (IS_ERR(sub))