Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1861436rwb; Fri, 19 Aug 2022 10:36:17 -0700 (PDT) X-Google-Smtp-Source: AA6agR53l6WaCCoJwKLmqYB5oymugEWsAb9YNDhg4+Rjz+steRNbfc6QZ2F+868/obncpehQjocB X-Received: by 2002:aa7:9e0c:0:b0:536:3967:5d01 with SMTP id y12-20020aa79e0c000000b0053639675d01mr1440962pfq.7.1660930576916; Fri, 19 Aug 2022 10:36:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660930576; cv=none; d=google.com; s=arc-20160816; b=CGndQMqN07n2/behiaLoX37PKpB8V7/PLb4Vi9K1V5hNblE7RkqJ6t17Ebb9DA371H I1AFzis61qoiV5CSnMcWl4yad8kqXwZfiqdjzn1Y7HInI4Y/wqmNWo8sF45py7Izipmt CaYd2tHjmj9k4jOkwrEt2YtWWe9dOCkXS/l2sDku78GpG2Hj445B30Ex2MJUgtA/ZFI7 Jq6ylBMUP37BcX3na/d5JHBSS0rLDBcpsnmG+TH5PdjM24aHlIfG4Suj5xdOhq1MeOea wGBpFwmrmPvlP+MhgFYI281Bm1xup9d3Eq9GVd2jtMIhJqwELAgwWgJTgS/kEru0YKiZ +AEg== 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=qp2Ynh2eLQkgSyS+vMWBv0x+9UcHaVJUBCXMzlNJdAxUVXcZNwh2H8AhHlynKKfZeE naull8edF6yHgxkrHpqyTWbU20RluzTp2zedUdCgMLLsA/PbOtzzk8b1WcZXJzWXY8o+ 6G1J3CEgCp95r98PvT9ajPVwmGuG9lht7lYg2vI3PL/i507k6j4MZEE5hORqjzJByJUy 0CE+XJd347/uXatBPjG3J85bNWfzLNO0i2IG3F0V5nDfmxmH/vQb51MxM8Hyv4OxoybY C+5imE/aUqcwR7IuCUGMzSJCjZIRaxBkar79WkZCHRli9EjWKA0Fgwz3NI+S1YlOCi9u SL5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=KIcme3Nw; 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 t185-20020a6381c2000000b004215af65dfasi2134411pgd.225.2022.08.19.10.36.04; Fri, 19 Aug 2022 10:36:16 -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=KIcme3Nw; 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 S1352754AbiHSQ3y (ORCPT + 99 others); Fri, 19 Aug 2022 12:29:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352809AbiHSQ1v (ORCPT ); Fri, 19 Aug 2022 12:27:51 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 720B4119469; Fri, 19 Aug 2022 09:04:19 -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 E4CB2B82813; Fri, 19 Aug 2022 16:04:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4754AC433D6; Fri, 19 Aug 2022 16:04:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660925050; bh=DF7PTMewUFfS/ZB+3tf2747d7ms+FLwktLmvT2BQnNg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KIcme3NwGKE94fbB74ESl+4BMvSPc8y20c+cy5FsrFfQdTHQuxzT23fXIZ1o0CEVr o4FIvVylsddeP7i6KrgOHg7Bn+SgI3Q4qSCBPmUOtd3GPG+CtfFZN3G5DD9kDataD+ hbE1sibJNXp5zSGSSFlgLijXfIZe+7/2rY+9w1Rw= 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 367/545] ASoC: mt6797-mt6351: Fix refcount leak in mt6797_mt6351_dev_probe Date: Fri, 19 Aug 2022 17:42:17 +0200 Message-Id: <20220819153845.826977864@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220819153829.135562864@linuxfoundation.org> References: <20220819153829.135562864@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