Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3086342rwb; Mon, 15 Aug 2022 17:47:47 -0700 (PDT) X-Google-Smtp-Source: AA6agR5p22JniR8a0A6Q9hRGpWaFpUpqYAM4QOrfK95EB61KLn2nmVJtE7QXvPcwpJRHEDWJJB6x X-Received: by 2002:a17:907:3daa:b0:730:a788:a6e4 with SMTP id he42-20020a1709073daa00b00730a788a6e4mr11800760ejc.77.1660610866876; Mon, 15 Aug 2022 17:47:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660610866; cv=none; d=google.com; s=arc-20160816; b=dcKYHqlprras0dfFw1GrKO9ZVaSYWRQk9yklOM84slD4qqIp5rei7vBVbsf8Orl9us 27g6fXGbMIbEe4CY7cJ+bd6gJQxPrypObdq7i6vAzFx2SyOzyxKDXGautHiw64gChbia QbRQm+vOPgFP5QuPQspYV7hJcqZRDPxv0Th0FR/h4vNAyePKfIAxrwbP/XNNJ/swd9i3 JAXaADeuXbLM5Am9AcUd5v0emqcbvS9jTKb+bFXxEXgngHOzmldiuxDPxuK1tJNBjoaq sg4/B9/omaVC+7hOe+//zqsTco62tMs2IPRbvwyqhT9YnitqtMqcCa/yij49C6reavB3 NzDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=GvMPLbMq3XUXOdcAKQSaUopRvvSsutIZvG/Scot92OA=; b=uh0/JaUkmtY/P45kwO0zfDTi1IIQHIHgcMRxm/UsgHQV6Cd/OFVc0M+RF9L+7vWnAD hOlsokLTNaa+AsSLXL/9EOjkeErAIAcx2GksKwZXvc+pJw8wjubWePc1ClExJcUJ9R4x xux00/rwy3FGZYTXu8uS8+aXO+WQSCC7xnxmb5389Mk7Q2b67VIGWPHWW7Fd3xKPRoj6 /gCSVZTnNNhAHdqK/rENhqX7uhDWNkVCPtGq8nXPGzjbKzZA8yu8RzFB4MNkyPCRHvKN pl5e+WwIrRV9Nb3e/zJfc6t581pJ1Tq3S0hYs2AeTtiX2u6X1CNtOK8QjzpfXtY1Xb0k II/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DG1WQUyi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m19-20020a056402511300b0043d31095588si9999088edd.240.2022.08.15.17.47.21; Mon, 15 Aug 2022 17:47:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DG1WQUyi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351473AbiHOWs2 (ORCPT + 99 others); Mon, 15 Aug 2022 18:48:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351801AbiHOWqv (ORCPT ); Mon, 15 Aug 2022 18:46:51 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B472134B8A; Mon, 15 Aug 2022 12:52:53 -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 B425760FB5; Mon, 15 Aug 2022 19:52:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0AF5C433C1; Mon, 15 Aug 2022 19:52:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660593172; bh=WF7gVEsWaD81stKo2H4fD5esY9t3YMHFHgogMQnH3z8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DG1WQUyiOjw07gDoZ3o9elYBg4rSn/X3/KfZjfVPq9czRXYGgeFl402sLPnv3Cb46 JNnYlK4vj/8unY6No5m7+J8et2eCsEESUy6rn6E0SrADFN89E4jGAlSPhx8GIQ3I5O /0MuX8tjjv4/qJ7AwJmDtpbZt2agYAmrBlukcDxc= 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.18 0906/1095] ASoC: audio-graph-card: Add of_node_put() in fail path Date: Mon, 15 Aug 2022 20:05:05 +0200 Message-Id: <20220815180506.782392479@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Liang He [ Upstream commit 65fb8e2ef3531a6e950060fca6e551c923fb0f0e ] 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: ae30a694da4c ("ASoC: simple-card-utils: add asoc_simple_card_parse_dai()") Signed-off-by: Liang He Link: https://lore.kernel.org/r/20220721144308.1301587-1-windhl@126.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/generic/audio-graph-card.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c index 2b598af8feef..b327372f2e4a 100644 --- a/sound/soc/generic/audio-graph-card.c +++ b/sound/soc/generic/audio-graph-card.c @@ -158,8 +158,10 @@ static int asoc_simple_parse_dai(struct device_node *ep, * if he unbinded CPU or Codec. */ ret = snd_soc_get_dai_name(&args, &dlc->dai_name); - if (ret < 0) + if (ret < 0) { + of_node_put(node); return ret; + } dlc->of_node = node; -- 2.35.1