From nobody Mon Sep 29 21:09:05 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 ADD10C282E7 for ; Tue, 16 Aug 2022 04:52:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233052AbiHPEug (ORCPT ); Tue, 16 Aug 2022 00:50:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232278AbiHPEo5 (ORCPT ); Tue, 16 Aug 2022 00:44:57 -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 E18964E857; Mon, 15 Aug 2022 13:42:17 -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 72BE66122B; Mon, 15 Aug 2022 20:42:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 77E65C433C1; Mon, 15 Aug 2022 20:42:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660596136; bh=nmjEp/2hKjCOI/DtssWsDSrg02t993fQ91et2D8Amhg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2bScRhKjXgJaZmBqrzZDS2xf23SPQu0p3wAvbRWSrxdlmyi1qj47b850Zhbxk3ZDv b3kjcvuHha/+QMaG02DNpdJ9PQU6WVVCzcHd0vcQC+gp+fc83Nwjh1q2whwY9cKMcC AV+oNWFEdAAb/sGjc1qJec7LlY3YHMRt428ewxYk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Liang He , Mark Brown , Sasha Levin Subject: [PATCH 5.19 0985/1157] ASoC: audio-graph-card2: Add of_node_put() in fail path Date: Mon, 15 Aug 2022 20:05:41 +0200 Message-Id: <20220815180519.136137982@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: Liang He [ Upstream commit 8ebc4dd8250fd1cb5da2869c0fe6ae3686fe41e9 ] In asoc_simple_parse_dai(), we should call of_node_put() for the reference returned by of_graph_get_port_parent() in fail path. Fixes: 6e5f68fe3f2d ("ASoC: add Audio Graph Card2 driver") Signed-off-by: Liang He Link: https://lore.kernel.org/r/20220722141801.1304854-1-windhl@126.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/generic/audio-graph-card2.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sound/soc/generic/audio-graph-card2.c b/sound/soc/generic/audi= o-graph-card2.c index 5dba7c89007d..a7144defb8fb 100644 --- a/sound/soc/generic/audio-graph-card2.c +++ b/sound/soc/generic/audio-graph-card2.c @@ -445,8 +445,10 @@ static int asoc_simple_parse_dai(struct device_node *e= p, * if he unbinded CPU or Codec. */ ret =3D snd_soc_get_dai_name(&args, &dlc->dai_name); - if (ret < 0) + if (ret < 0) { + of_node_put(node); return ret; + } =20 dlc->of_node =3D node; =20 --=20 2.35.1