Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3407074rwa; Tue, 23 Aug 2022 04:22:49 -0700 (PDT) X-Google-Smtp-Source: AA6agR6MPCV8DXBbrdWEwUrKhvoXiW+LVXLG9HkmseP52XPdppIsyj8auEZP1zs9StTrnel7t63i X-Received: by 2002:a17:90b:4b8f:b0:1fb:10e2:5c99 with SMTP id lr15-20020a17090b4b8f00b001fb10e25c99mr2885714pjb.194.1661253768991; Tue, 23 Aug 2022 04:22:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661253768; cv=none; d=google.com; s=arc-20160816; b=GAmNPoFFT8yRZST0oLMC7AwYTZjP3DHcwkPo2R9fnB62hOalV8wCuOQzJ43cAwi/Qq MgOb5J9AVOOYZ8OR4SUwDoxAiJVuNb9j0JZND3wVqT1hXGZKi+rVKL16Iqe6ehpp64k9 h9d7O4EHFKvv6eYVMkS9MbZf8NEgZjHzHEx8ktgo78UXtKB8fMrigv+Z07/zQcr7pGed fwIXT3wrL4Wqht4r2RrEb7C+xpUYJ/XDLfQQHvy7iEon5q/DOJZD3ljkfgW1B6Hk9fk5 YY4gHjfN/ApFyLvy7qpHhuqQNXTCmvtCjWfgqo+1Y9/J+jyHinWjtG5NhujIyfr33XIc sOGQ== 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=MuGm7Wmmj38vhB41BVv6M1dmIx/nSBkbFu1VtOTvyq8=; b=VahDWevDdXne55Cn6rTGU2Zp6tXssVoAyj5F1WYsMz7LE54bW3yCTTNZVVu5ysI00l XVYRsAqFMKovTGyZrKPhketjO4amL5ovmEjeN7UVN90G7hFhs12K8TDIJdSxvm5RbLvC sZ4az35mXVHNp5gF2VjX6TDOLQeY/fVDd9tB3hKPZQEaXkI7ilb0pe8kY7b95BiptB9m 8+DVrHwSkvq1+Z2XpKbZYysH8zhsr/+t4nnBOxswZVOBy3iImtST7IEWsbI5WGpjZSIz LIkDqwg190GxhuiimUPe6Q/Ft4Md3wYFvacnZ3L+TYq8/MW6aRvBGaSZvcu88wfxoDPZ aE5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ce0qTmfc; 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 9-20020a631849000000b00429cd0df384si15416987pgy.520.2022.08.23.04.22.38; Tue, 23 Aug 2022 04:22:48 -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=Ce0qTmfc; 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 S1355904AbiHWKpi (ORCPT + 99 others); Tue, 23 Aug 2022 06:45:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355197AbiHWKiF (ORCPT ); Tue, 23 Aug 2022 06:38:05 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8035D85FCF; Tue, 23 Aug 2022 02:07:36 -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 E675EB81C85; Tue, 23 Aug 2022 09:07:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3B583C433C1; Tue, 23 Aug 2022 09:07:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661245653; bh=7gKvBrCgfjXar+M7RVKi01m33VmCzuS0lNw/8ARW1do=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ce0qTmfc7kECKhW29Ax3dsD6MuATph4C9AeWK6kCEEOPcVh5Edthlu6EtjeCEWjjL gFva4q6Gh80XaN8yZevnJPkvEotM4pr10bn+kGdjDpjjRYUdU6FepbHr4TCXiUlfUH Lt41RxvYN9iZFMccfXPJ8sM6lwQGtYRbhiFCj2vw= 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 4.19 147/287] ASoC: mt6797-mt6351: Fix refcount leak in mt6797_mt6351_dev_probe Date: Tue, 23 Aug 2022 10:25:16 +0200 Message-Id: <20220823080105.522496550@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080100.268827165@linuxfoundation.org> References: <20220823080100.268827165@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 b1558c57b9ca..0c49e1a9a897 100644 --- a/sound/soc/mediatek/mt6797/mt6797-mt6351.c +++ b/sound/soc/mediatek/mt6797/mt6797-mt6351.c @@ -179,7 +179,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 (i = 0; i < card->num_links; i++) { if (mt6797_mt6351_dai_links[i].codec_name) @@ -192,6 +193,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