From nobody Mon Sep 29 21:18:52 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 31FA0C00140 for ; Tue, 16 Aug 2022 00:37:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345381AbiHPAh1 (ORCPT ); Mon, 15 Aug 2022 20:37:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344061AbiHPAek (ORCPT ); Mon, 15 Aug 2022 20:34:40 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D567B187FBC; Mon, 15 Aug 2022 13:37:23 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 8FD70611E2; Mon, 15 Aug 2022 20:37:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 80D1EC433C1; Mon, 15 Aug 2022 20:37:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660595840; bh=zKoOUGLc9GCXGCCdM2OM3y02a5kExyeYGGHCHrGuQzQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZcSwslqt51fB5uQPqo+DYSkeR31tjax4FMFeyQQAWbwwMWSOMt1ub1OQXFNLBP9jO 7cX5ExnLMmjqKOUo595F/TMvlfYpAtJmbwsKL/faQ/v4pq5SpusLsdKnfQccCNI/ye FiLXU7c8qyt/9DL7gr3zkkLTj/4sVBZbQcMQVRVU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Krzysztof Kozlowski , Mark Brown , Sasha Levin Subject: [PATCH 5.19 0891/1157] ASoC: samsung: Fix error handling in aries_audio_probe Date: Mon, 15 Aug 2022 20:04:07 +0200 Message-Id: <20220815180515.081357047@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@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: Miaoqian Lin [ Upstream commit 3e2649c5e8643bea0867bb1dd970fedadb0eb7f3 ] of_get_child_by_name() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. This function is missing of_node_put(cpu) in the error path. Fix this by goto out label. of_node_put() will check NULL pointer. Fixes: 7a3a7671fa6c ("ASoC: samsung: Add driver for Aries boards") Signed-off-by: Miaoqian Lin Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220603130640.37624-1-linmq006@gmail.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/samsung/aries_wm8994.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sound/soc/samsung/aries_wm8994.c b/sound/soc/samsung/aries_wm8= 994.c index bb0cf4244e00..edee02d7f100 100644 --- a/sound/soc/samsung/aries_wm8994.c +++ b/sound/soc/samsung/aries_wm8994.c @@ -628,8 +628,10 @@ static int aries_audio_probe(struct platform_device *p= dev) return -EINVAL; =20 codec =3D of_get_child_by_name(dev->of_node, "codec"); - if (!codec) - return -EINVAL; + if (!codec) { + ret =3D -EINVAL; + goto out; + } =20 for_each_card_prelinks(card, i, dai_link) { dai_link->codecs->of_node =3D of_parse_phandle(codec, --=20 2.35.1