From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796390500; b=rJ+oKqFLVVMJOcZ08Ds4vl91ilWna2XrsZEk0e/lXJGn3/Zhg/CToxgBfV/jX+eY5qkI jZJVEGQ7AdmSNYPYmVCTNzUEchxG7rQn+tz/MDZqFp1sF3TF6WDUrb69FAmr7ep64IgUK AdcOlid0eKNrzqZXaeHBh3g4jsMOembrl7dh5YGk76xmZ5+GL9UTyV+fHnzvitZ6LbjB3 Lnakrkc8UIgnDRcGNEZjicWW5cnIe7EzG9HVaGbAZOQUg2VqEFexF0NfGBhcyJYA5a1jy OFYBcjT4/XIgZLwvHDTflq/6/HCaZrapcD5l4tAVTZnRL2QdQW0ZgG0zmnaWFl2AMsw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796390500; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=hmaC7k2hvSzR7TE0wDIrxaO37p+mZP4bYUrBq8HNUCI=; b=YM3TvQnVwpBuI3vVJhn20jM/VRTSWZubUjLK3i2vKPyJ8VnJcyO5QJY+m5l6pl9CnZq8 yynZgLAnOYfF+EG59Mjtp0Fwg4qQKaRp1HmFBSejhm5k15gJBqIjhQR3MdRHarHjhAnKa Ya/O13TVKTN4Pu/XY+m0zDAKoUCEv7POufNufl2mZkIwqmhV6l1WOxoYJ6wOu5sJx89Rl thncZ0v6+WKBpdIR+iKvYKyPmunstHsAf47NbZ1uXg4lZOfBeBSJVkaa8is3T+9sx1tZ7 rUUuI98BshNE70fQ2HWtfJ61AclvMjCPIUtnGLL6u46CxFEaT6b9CfP6AeBw8W6t6kg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=i1pbY5sh; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 837B5606A322 for ; Fri, 4 Dec 2026 13:21:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=i1pbY5sh Received: by smtp.kernel.org (Postfix) with ESMTPSA id 988371F000C2; Fri, 4 Dec 2026 13:21:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796390499; bh=hmaC7k2hvSzR7TE0wDIrxaO37p+mZP4bYUrBq8HNUCI=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=i1pbY5shjC4A09KTdsfOELQ7gaegMDW6BEZBcpwQgLo5w6m4SjKI4KU8/+B4yQklF SSv4YYrW1z55IqoEBQRPJanJKN34SsHU3TocMqOxT7+jWTgohng4SLqwZLGzWKG8V+ 98yuqz/GmFW8hwtDkhwBFm5Uz7HWketCtfIUjxxfnB4bHKZyQrTjehNxpq0wyv2DoC TdHWt6E17t4EyYTeXGLKtRwLY5m9zfwhNsHikAzZsB/qIEgMgCQ6MzWSWC5DkW/PYQ wT3yqBdOK4+YkvhqcxWEjxJz53lQW935RjaM2xlRDXxsNKjTtR8KJKx1R0U5rH/tA+ 9XsjbuT4tDEyA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v2 1/4] ASoC: codecs: pm4125: check component match allocation Reply-To: sashiko-reviews@lists.linux.dev To: "Zhiqi Zhang" Cc: linux-sound@vger.kernel.org In-Reply-To: <20261204125837.81419-2-zhiqizhangg@gmail.com> References: <20261204125837.81419-1-zhiqizhangg@gmail.com> <20261204125837.81419-2-zhiqizhangg@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 13:21:39 +0000 X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] ASoC: pm4125: driver workaround conflicts with component core error handling -- commit 5670d13c3334f605590dbc9132ebd2c33509847a Author: Zhiqi Zhang ASoC: codecs: pm4125: check component match allocation This commit checks *matchptr for error pointers after each component_match_add_release() call in pm4125_add_slave_components() and drops the corresponding rxnode or txnode reference on failure. > diff --git a/sound/soc/codecs/pm4125.c b/sound/soc/codecs/pm4125.c > index 22fada77b2740..f5b37ec038276 100644 > --- a/sound/soc/codecs/pm4125.c > +++ b/sound/soc/codecs/pm4125.c > @@ -1625,18 +1625,31 @@ static int pm4125_add_slave_components(struct pm4= 125_priv *pm4125, struct device > struct component_match **matchptr) > { > struct device_node *np =3D dev->of_node; > + int ret; > =20 > pm4125->rxnode =3D of_parse_phandle(np, "qcom,rx-device", 0); > if (!pm4125->rxnode) > return dev_err_probe(dev, -ENODEV, "Couldn't parse phandle to qcom,rx-= device\n"); > component_match_add_release(dev, matchptr, component_release_of, compon= ent_compare_of, > pm4125->rxnode); > + if (IS_ERR(*matchptr)) { > + ret =3D PTR_ERR(*matchptr); > + of_node_put(pm4125->rxnode); > + pm4125->rxnode =3D NULL; > + return ret; > + } [Severity: Low] Should this be fixed in drivers/base/component.c instead of working around = it in pm4125_add_slave_components()? Both issues originate in the component core: __component_match_add() returns without calling release(parent, compare_data) on allocation failure, and component_master_add_with_match() dereferences match->num without checking IS_ERR(match). Because component_match_add_release() returns void to let callers batch additions, wrappers like drm_of_component_match_add() take an of_node_get() and leave callers no way to drop it on error. Manually calling of_node_put() here leaves those other callers unfixed and will cause a double of_node_put() if __component_match_add() is later fixed to invoke release() on error. Calling release() on the error paths in __component_match_add() and returni= ng PTR_ERR(match) when IS_ERR(match) in component_master_add_with_match() would handle both problems uniformly for all callers. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204125837.8141= 9-1-zhiqizhangg@gmail.com?part=3D1