Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3121977rwb; Mon, 15 Aug 2022 18:39:51 -0700 (PDT) X-Google-Smtp-Source: AA6agR6QYI73uGS9tVPuzrNx6lulYR1A2zzFPnqYeAhoPoG6O8TgIyRXPwCKbIEtXpHB8/G39kdJ X-Received: by 2002:a17:906:5a73:b0:730:9e88:1cde with SMTP id my51-20020a1709065a7300b007309e881cdemr12140620ejc.741.1660613991281; Mon, 15 Aug 2022 18:39:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660613991; cv=none; d=google.com; s=arc-20160816; b=POydf8kh9nUHIDNkGb/BJFkwcOSGzwfHX+DA/XiiVjjep8cCLgUDDsXIptjWuv0K2d PpakhTzceif+Gu4uED8FOjQs/+ACyAYOY9/EsA6WSiGSPnSlq89cfqTBOHg7lSpy5AXa jEfx0h2c2bHbUSWIds7ODQaZn0Zd84b26qghub3KPSOQmM/lz2gWsmNhOcU1ZpLUkSLN TEfAF9tpNhbJA2RTC+/V2A9bSfXMn7HbbmwoexnOOpktOxxaesBcaBdG+PmUhTtzzw8H rHzzFKRp0Vg1P/dyugat5CGWGbC5ijzpd/absnSulNVUwTeZ9wtbhPr8tAu4cV3mLJ9+ YYTg== 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=IkjB7pJZzqcCrv/b+hqBN+S/AWAC7lfBNpLNiwpKdWAPwT2Ov/vwOvNFug1hXxKOIW mPJLZl+L5s3m9/UO7aTGs6mTp/2j4nf0GtH4+HJkzBD2c0jnCQHEWiVBV2Q9F7r2cD+C N0yM0W4o+BkVk1XWohceuuswoU+hcnxtaMYPuEcQ0H0ATXOOnzcqh2c7fttbOykAKfaO eAox0qvkClxZ2escU1zQQ6wFpF7/sbYOMOfNsoSBSLuAYutvjzvmHigiwaZJSpsVfM00 vUv0EFeYrof6TLpakN3ZUPP3hSYAzA0VCACqWlZcVZJEvrN7zEVYrsGZ7VVurfejXN4C vsrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vQCxK2id; 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 g6-20020aa7d1c6000000b0043d35059c65si8561584edp.160.2022.08.15.18.39.25; Mon, 15 Aug 2022 18:39:51 -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=vQCxK2id; 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 S245148AbiHPAiX (ORCPT + 99 others); Mon, 15 Aug 2022 20:38:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351119AbiHPAgP (ORCPT ); Mon, 15 Aug 2022 20:36:15 -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 DB7BC1894EF; Mon, 15 Aug 2022 13:37:39 -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 BE258B80EAD; Mon, 15 Aug 2022 20:37:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F0FF6C433D6; Mon, 15 Aug 2022 20:37:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660595855; bh=DF7PTMewUFfS/ZB+3tf2747d7ms+FLwktLmvT2BQnNg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vQCxK2id2K4DZrRUtNYpkoCsiOIA1V0GBglNMk12t9p0m+2JbEd7c8JxqPoFxdgYF Cg2GyZKmzd2/9Zkn2SXru5EAAqI1Mn6mHhdS1sVgjGECvlNPt+2RPsXDLnFTWVZGOo /iBpu1ZJL4I2tW1v+TH/4DtP4O0RC/qIHlzZnjoE= 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.19 0895/1157] ASoC: mt6797-mt6351: Fix refcount leak in mt6797_mt6351_dev_probe Date: Mon, 15 Aug 2022 20:04:11 +0200 Message-Id: <20220815180515.241586721@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-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