Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2160335iof; Tue, 7 Jun 2022 21:46:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyza8E4uBaQCu/4yllp40aqAEjJSoS3Lk/YDynaArE1WSxhnD9pN8lLr+62Nq0c97HqNZjN X-Received: by 2002:a63:d50c:0:b0:3fd:3c6a:47c5 with SMTP id c12-20020a63d50c000000b003fd3c6a47c5mr20029728pgg.555.1654663564633; Tue, 07 Jun 2022 21:46:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654663564; cv=none; d=google.com; s=arc-20160816; b=e1LKKb2pqCdp2Z1Vc/ytNnWbKoLmyP07XMdTOlcp55Uhcppi+ZVC0J5yBDsJJsHwNu l6XsYJGXAIIlme8JTS9CwquZTei3qpdXf6Ad4lGHcERPwKS8nPKMx6NAaWLPgxCywmr9 BWOAg+07cqEZHvOKpkUBJ6jkJSAfZiEkSRCFBqYdKQLz8Jhzgr7uQ0eP25pecqj3/YQ/ F2XMbiK17WRYirSOAizGHOSseXQRjp6IXMVhg9j73RAa8qx7pjL1KFklQQeo3hjlHf+R g1xVvlF/t8mmfCTHpHfuLA9gJU/rHhKKy+TgJOeJZMkgZqp0yWvo4vPoFjZkDZZSirDh kIZQ== 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=xLEy8n2DxivB9h30cu4tVoYbwCcRyuqNrXuh5vvIeUQ=; b=z1zxNcDYhP4BMrJ0Eo9PKx4kXyfC0qK7DUd582x69/jVIGUTFDe1FlMK6gC2vuWbRL rPFcNTPijdFl3bc4Z9l+sBCG/G5Rxr1+jiJloY6if/OSTKa1PVNCqTKH7TV9gTD70y7U W7WI2++qNW8qCl/kgfajpmmOE4VYay7NcgLGaIvoBtCYlRNUlmaiW+6+KQtza5hHN6n3 QvVuKYZ3MCP2OKybZOKvZtnyEtY7v2Vra5BVM7RbHmvp36Xwv9j2MD15YEauho2lAi0E hxOIffyblRArN2UY3+/kwWq22TfAUp9GCEyvohQ9pRrI3lKxkisTj14I4fJX+iww/JT5 Uk9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=155ErHLk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id e6-20020a170902ef4600b001663333529csi25724168plx.260.2022.06.07.21.46.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 21:46:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=155ErHLk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1ABA72E0F01; Tue, 7 Jun 2022 21:17:30 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1385233AbiFGW0n (ORCPT + 99 others); Tue, 7 Jun 2022 18:26:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381452AbiFGVRo (ORCPT ); Tue, 7 Jun 2022 17:17:44 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB6A52228E5; Tue, 7 Jun 2022 11:58: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 sin.source.kernel.org (Postfix) with ESMTPS id 4BA20CE244E; Tue, 7 Jun 2022 18:58:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 10CDAC385A2; Tue, 7 Jun 2022 18:58:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654628330; bh=g8nzPa7JapSk0M9r9c1N9ngg8LkaT/SpLFWBhIgeGHc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=155ErHLkdxdMK7taruDYv2uOcxutRlas43S7k+z2IHLdg8iWRcOhkmHX0SQ0xFM4t MeXLTrs99/oUPRfSLFJyBZw3EUK38ooQmHeDBzqQX5eMD1pUgZAl7FG8gYwX+B51gL 1lgwFM06Gp3HWI4t6d9rCpDtFx641i3FWGwyMx1E= 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 283/879] ASoC: mediatek: Fix missing of_node_put in mt2701_wm8960_machine_probe Date: Tue, 7 Jun 2022 18:56:41 +0200 Message-Id: <20220607165011.062219565@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 05654431a18fe24e5e46a375d98904134628a102 ] This node pointer is returned by of_parse_phandle() with refcount incremented in this function. Calling of_node_put() to avoid the refcount leak. Fixes: 8625c1dbd876 ("ASoC: mediatek: Add mt2701-wm8960 machine driver") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220404093526.30004-1-linmq006@gmail.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/mediatek/mt2701/mt2701-wm8960.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sound/soc/mediatek/mt2701/mt2701-wm8960.c b/sound/soc/mediatek/mt2701/mt2701-wm8960.c index f56de1b918bf..0cdf2ae36243 100644 --- a/sound/soc/mediatek/mt2701/mt2701-wm8960.c +++ b/sound/soc/mediatek/mt2701/mt2701-wm8960.c @@ -129,7 +129,8 @@ static int mt2701_wm8960_machine_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) @@ -140,7 +141,7 @@ static int mt2701_wm8960_machine_probe(struct platform_device *pdev) ret = snd_soc_of_parse_audio_routing(card, "audio-routing"); if (ret) { dev_err(&pdev->dev, "failed to parse audio-routing: %d\n", ret); - return ret; + goto put_codec_node; } ret = devm_snd_soc_register_card(&pdev->dev, card); @@ -148,6 +149,10 @@ static int mt2701_wm8960_machine_probe(struct platform_device *pdev) dev_err(&pdev->dev, "%s snd_soc_register_card fail %d\n", __func__, ret); +put_codec_node: + of_node_put(codec_node); +put_platform_node: + of_node_put(platform_node); return ret; } -- 2.35.1