Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3018771rwb; Mon, 15 Aug 2022 16:15:37 -0700 (PDT) X-Google-Smtp-Source: AA6agR4XLt8sHAtg/cC4z7DgINiRzkbJ3usCRHAgONsMOn2MVa9utszw6mW5SDUrX4vxbTjcRjWT X-Received: by 2002:a05:6402:25c6:b0:43b:7797:d953 with SMTP id x6-20020a05640225c600b0043b7797d953mr16381890edb.254.1660605337432; Mon, 15 Aug 2022 16:15:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660605337; cv=none; d=google.com; s=arc-20160816; b=LX2x15zkG2W/c+78hj5a+1XXgSb5E5BVvjC0JNoT/DdfhSOTTxXPQ4b5fiIyB+xSDs 6RHuQkV2x6XfT2TXVF1sBitFOYXpxfOXPCOf3lSqTVawYB6/jdu0FmgobsioT1qRIK/g v9Zl499cjVkCOZ6Ksfkx13ub+qD1XzB7FHnQyFAYQYPMI7h73WYnKP7JN2JIcNP6PCKv U+Qni/s4BusLALtT2uvE97v87bqV6Bm7SE7Kl0nG2EvVSL9pbRsKEJQbNOUJhLjLYFA8 LASYsPohe0CfJYWhYjH77XgICQrcpwi6RZXKFk3UTCktNzD8rtTSlrQ0G1Onh7ZSuW42 53GQ== 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=5h6xKbz9j0AKvty/hIKfQUUnCM9f/eWCe5RgYXNSyRQ=; b=b4LSvSEdj6debfsBFPawyAj+oUgPEojiJbOVV3E9akj53yvQbpWBa7g4oCwFzhtwBy U48WUv4nvAPLrR+EdcYMmH1rYZVRDkMPvrGeijWcqfeVblvVevMlZry0JfAXH2d5C8Cl NOKJxeEY+NXH7I5qrkwfMIx4SqXlb3QMABpY3ys6M9nY7FGIOrpxl9EmbA6TpTmhUjzV lXw/f6XHbD9vHPQWWV1EdmBw8KTON8ijieF7exkG+l6Wv+W9ggmySfdeM9pFzzL/EZUP J3+Hzl6+5LYsFDI843MwnW5Y3lk0SJmtlpkWWS4+5yecBZQSlHYhvuXKu9eDHXRIbG+C RlZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="sx/pJikv"; 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 nd39-20020a17090762a700b00706fe017e89si5880448ejc.880.2022.08.15.16.15.11; Mon, 15 Aug 2022 16:15:37 -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="sx/pJikv"; 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 S1349963AbiHOWbS (ORCPT + 99 others); Mon, 15 Aug 2022 18:31:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349829AbiHOW0J (ORCPT ); Mon, 15 Aug 2022 18:26:09 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1B14127BD8; Mon, 15 Aug 2022 12:44: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 F2458610A3; Mon, 15 Aug 2022 19:44:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E42EDC433C1; Mon, 15 Aug 2022 19:44:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660592692; bh=DF7PTMewUFfS/ZB+3tf2747d7ms+FLwktLmvT2BQnNg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sx/pJikvw0a/2viCcrcJXg4bORHOpRYhnyLWgW+dH4RLzX4jRRB8xyetaIzT5eF13 eB4UCEvL4yxs9uuvZWUCzTTcY4f2jw+kwPFNBvHpMo43gP6hpMOflGdcvRNIe2y5qZ 5GyP2VpRKzd/uJ0YZlmLu4PNv9evjQgxZnTr0+Ks= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Mark Brown , Sasha Levin Subject: [PATCH 5.18 0831/1095] ASoC: mt6797-mt6351: Fix refcount leak in mt6797_mt6351_dev_probe Date: Mon, 15 Aug 2022 20:03:50 +0200 Message-Id: <20220815180503.691733395@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: Miaoqian Lin [ Upstream commit 7472eb8d7dd12b6b9b1a4f4527719cc9c7f5965f ] of_parse_phandle() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() to avoid refcount leak. Fixes: f0ab0bf250da ("ASoC: add mt6797-mt6351 driver and config option") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220603083417.9011-1-linmq006@gmail.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/mediatek/mt6797/mt6797-mt6351.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sound/soc/mediatek/mt6797/mt6797-mt6351.c b/sound/soc/mediatek/mt6797/mt6797-mt6351.c index 496f32bcfb5e..d2f6213a6bfc 100644 --- a/sound/soc/mediatek/mt6797/mt6797-mt6351.c +++ b/sound/soc/mediatek/mt6797/mt6797-mt6351.c @@ -217,7 +217,8 @@ static int mt6797_mt6351_dev_probe(struct platform_device *pdev) if (!codec_node) { dev_err(&pdev->dev, "Property 'audio-codec' missing or invalid\n"); - return -EINVAL; + ret = -EINVAL; + goto put_platform_node; } for_each_card_prelinks(card, i, dai_link) { if (dai_link->codecs->name) @@ -230,6 +231,9 @@ static int mt6797_mt6351_dev_probe(struct platform_device *pdev) dev_err(&pdev->dev, "%s snd_soc_register_card fail %d\n", __func__, ret); + of_node_put(codec_node); +put_platform_node: + of_node_put(platform_node); return ret; } -- 2.35.1