Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2177230iof; Tue, 7 Jun 2022 22:16:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/VbzcHoaMnh1axqqPkOd3QN5nLW/VWUHotHLqG3VwMrd1sjssXjqvcZjVSdfA3NrYqpDo X-Received: by 2002:a17:902:b282:b0:163:ffe6:2cf9 with SMTP id u2-20020a170902b28200b00163ffe62cf9mr32910206plr.76.1654665401517; Tue, 07 Jun 2022 22:16:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654665401; cv=none; d=google.com; s=arc-20160816; b=ZN1ZM4m1jYKUrVwWRnNc+O2zU1dpbMJFnT6t3movOJA2Z3TyTtNhCmAYNWNBFkHm/C m0pQJbwM3sK0KhrkcZHt8sWYl91BClQjicMbHIivmcXnSUQNddIzFiBx2ePZ5eMV8+y3 a2qa3TL6QhDmBjs+CXfgzzv9VMXUEYoV7tVj8QXirtDgKCT8sVNdu0ybSyLJkNTQ1UMB f7Hr0SylpRJ7D6mP/OqtF8ptEftz2Dy6hzU0HkMSrd/IhO6ANLk0y3PaAiUX/6rI1sig 5myLPZK4Q6KIhYtZQ235vP9oqR5Jf+JmhCaRiTYmKFQHLe2wj8aBdDb/XMcLVlLvhS/W gdIA== 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=o+8+nvoFfI7JxFO+jgH/nYsXxuON1rJx493XjeTDiWg=; b=yjoZO3fyJyR7DxwUXKW4iob2Z/EvheKefayS2lj09Bt5VWNqcbxXeKMSFTERiubk+p K5sBqbeizybpH6PfE19wUljvByGjqffx+d5h/aTphETd+5zZWKecao6+59lPHZf2pdgF FeLgHMdLuA9A0EB0V3iZ0Kdkt4VH/VmWGndhej2PMhY6Zhl5wgfCUeOXOMUi7RyAdt5Y Bk0j2fBCp4UqmWM3+hoyx/ra+164ZTZX0PWVGVzx73jzsZsnbyeIUPlzYaRAC8MV4iNr L1xhM28fDNBn41L2J0aUCdwa350IkTOypivJaObZ4jQUy4/vKkyR1oJDch84QEkvS2nb NgQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mxBVEKAu; 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 mq8-20020a17090b380800b001e0484bae70si27868905pjb.57.2022.06.07.22.16.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 22:16:41 -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=mxBVEKAu; 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 8C2832D53B2; Tue, 7 Jun 2022 21:45:57 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347034AbiFGRaA (ORCPT + 99 others); Tue, 7 Jun 2022 13:30:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346968AbiFGRZg (ORCPT ); Tue, 7 Jun 2022 13:25:36 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0B24108ABC; Tue, 7 Jun 2022 10:23:48 -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 88EBA60BC6; Tue, 7 Jun 2022 17:23:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9221AC385A5; Tue, 7 Jun 2022 17:23:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654622628; bh=8WCFGA2VJEpCJtdMXqgC4paTvH7glqiBPPpo4OjQHIY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mxBVEKAuKjhRBGavc3uZI69iJ0rGvcexejLQLMle3HU1pCgyPAh7pcyA5PQwBpGcg YYLziJvY+x86RUuRqmaTOdT0J0XVl4O31wdskB2ZItjzHtqwDsV0cBTe+JFKHhF0T+ gs8FzYGDlfSTC0AxudPmjwbyMOae1IPkNGAH5vfA= 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.10 128/452] ASoC: mediatek: Fix missing of_node_put in mt2701_wm8960_machine_probe Date: Tue, 7 Jun 2022 18:59:45 +0200 Message-Id: <20220607164912.372931222@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607164908.521895282@linuxfoundation.org> References: <20220607164908.521895282@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 414e422c0eba..70e494fb3da8 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