From nobody Wed Sep 3 06:44:33 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 45F96FA3741 for ; Mon, 24 Oct 2022 12:31:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230329AbiJXMbi (ORCPT ); Mon, 24 Oct 2022 08:31:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233715AbiJXM2w (ORCPT ); Mon, 24 Oct 2022 08:28:52 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C819585ABF; Mon, 24 Oct 2022 05:02:28 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 060B3B811C9; Mon, 24 Oct 2022 11:59:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 64BE6C433C1; Mon, 24 Oct 2022 11:59:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666612740; bh=lRwAxn9o2pouRDfUnd3VBJnNd7BIGUUk0OlswBK4tO8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Kn6PlV6Sk1jgTukx/3CyPY3sZitX7wPAc7PUwfIuY0AGFwZjHPVdkkfUm1yohmqaN jWIzcmt2eA6I/G/IKi1S4hBHEM/mj+mqD271onSILKEpGFp18AEILKT8PsJ08ahZaL S2ilF68SelJOjO+g2YNcehg9//9s9RxcMkbdtPx8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Liang He , Mark Brown , Sasha Levin , Kelin Wang Subject: [PATCH 4.19 101/229] ASoC: eureka-tlv320: Hold reference returned from of_find_xxx API Date: Mon, 24 Oct 2022 13:30:20 +0200 Message-Id: <20221024113002.294662750@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112959.085534368@linuxfoundation.org> References: <20221024112959.085534368@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Liang He [ Upstream commit bfb735a3ceff0bab6473bac275da96f9b2a06dec ] In eukrea_tlv320_probe(), we need to hold the reference returned from of_find_compatible_node() which has increased the refcount and then call of_node_put() with it when done. Fixes: 66f232908de2 ("ASoC: eukrea-tlv320: Add DT support.") Co-authored-by: Kelin Wang Signed-off-by: Liang He Link: https://lore.kernel.org/r/20220914134354.3995587-1-windhl@126.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/fsl/eukrea-tlv320.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sound/soc/fsl/eukrea-tlv320.c b/sound/soc/fsl/eukrea-tlv320.c index 30a3d68b5c03..3705b003f528 100644 --- a/sound/soc/fsl/eukrea-tlv320.c +++ b/sound/soc/fsl/eukrea-tlv320.c @@ -87,7 +87,7 @@ static int eukrea_tlv320_probe(struct platform_device *pd= ev) int ret; int int_port =3D 0, ext_port; struct device_node *np =3D pdev->dev.of_node; - struct device_node *ssi_np =3D NULL, *codec_np =3D NULL; + struct device_node *ssi_np =3D NULL, *codec_np =3D NULL, *tmp_np =3D NULL; =20 eukrea_tlv320.dev =3D &pdev->dev; if (np) { @@ -144,7 +144,7 @@ static int eukrea_tlv320_probe(struct platform_device *= pdev) } =20 if (machine_is_eukrea_cpuimx27() || - of_find_compatible_node(NULL, NULL, "fsl,imx21-audmux")) { + (tmp_np =3D of_find_compatible_node(NULL, NULL, "fsl,imx21-audmux")))= { imx_audmux_v1_configure_port(MX27_AUDMUX_HPCR1_SSI0, IMX_AUDMUX_V1_PCR_SYN | IMX_AUDMUX_V1_PCR_TFSDIR | @@ -159,10 +159,11 @@ static int eukrea_tlv320_probe(struct platform_device= *pdev) IMX_AUDMUX_V1_PCR_SYN | IMX_AUDMUX_V1_PCR_RXDSEL(MX27_AUDMUX_HPCR1_SSI0) ); + of_node_put(tmp_np); } else if (machine_is_eukrea_cpuimx25sd() || machine_is_eukrea_cpuimx35sd() || machine_is_eukrea_cpuimx51sd() || - of_find_compatible_node(NULL, NULL, "fsl,imx31-audmux")) { + (tmp_np =3D of_find_compatible_node(NULL, NULL, "fsl,imx31-audmux")))= { if (!np) ext_port =3D machine_is_eukrea_cpuimx25sd() ? 4 : 3; @@ -179,6 +180,7 @@ static int eukrea_tlv320_probe(struct platform_device *= pdev) IMX_AUDMUX_V2_PTCR_SYN, IMX_AUDMUX_V2_PDCR_RXDSEL(int_port) ); + of_node_put(tmp_np); } else { if (np) { /* The eukrea,asoc-tlv320 driver was explicitly --=20 2.35.1