Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2140943iof; Tue, 7 Jun 2022 21:06:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1l8X5Jyb0lL9KLPuUQE97B84IKQdGtQYiqIPq7xa1JaJBWHdtOmKCW4kysMPjinFg+UV2 X-Received: by 2002:a05:6a00:882:b0:510:a043:d4bc with SMTP id q2-20020a056a00088200b00510a043d4bcmr32953101pfj.64.1654661217893; Tue, 07 Jun 2022 21:06:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654661217; cv=none; d=google.com; s=arc-20160816; b=YUKgb0JTZ49nOVLaDupdNPavnH/cS6m5P3cHdpGdFvqPC/Sr0muASY50ZgMPACRk0u SZkIMJS1nz/wxRSqiv8R7sOdMPMYq9GkvIRXh7O2FjDKHnlI+HpVgcLB664rPN+V4LrJ Xz4rFNma7eLD1DBOpvfWRFhw+nxOMlmqEadvF9scaLiEaOL0k8g97OwORQIk8UozbcfP j5nbTIa+o51saWtS8MAgm4v+oePT+UfB0Ko1VnAD5+gfqeiXbjeRamWk305nbC20Jhvw yzscsuY7f67BAcTVzyvD8tXtyQlgnWuKJ1qoeVwAyMziVXI9u5t2W09RrdZgs1irSPQ8 4N1Q== 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=QaDEYpSiKVa8TNS8RuB+YpyKzghqEt75Apv7w9SrkPE=; b=OeAvamSGx+Ze8NISYc8D4CK/QaJC/DitcakwjKndY5c+/Xg08I2x1oHAVfWbIoNi8e EEl9Aust5aKbsmE3XnR41kwfdR/Ijg9VKdLL/7y1TlZACIhgGvoclFq7dl5BlnhG4kSz g1R0E0AngQ3g5OlYF/7t0cNanlvBCLDjqv/zes9XsdOfdMXKNCtoKVlYIX2o7gTuk+n7 TfKPhs/bNd85OLLCoMlgXQLN0bv2MPSvHoj7cjRfmsL3umh0i5aTnUMqv5CFHvQuryX0 jR4Dj9VNgIGEb21l3UC1eZTDXWWhHm8YJZcm3Ewcdz45u5iEWp6Vg3RvG0JLgRIu4jch 43PA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hSRgaJTV; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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. [23.128.96.19]) by mx.google.com with ESMTPS id g26-20020a63201a000000b003f9caa62632si26544228pgg.65.2022.06.07.21.06.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 21:06:57 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hSRgaJTV; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 0D8A817A8AA; Tue, 7 Jun 2022 20:32:48 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1380935AbiFGWhE (ORCPT + 99 others); Tue, 7 Jun 2022 18:37:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378606AbiFGVXz (ORCPT ); Tue, 7 Jun 2022 17:23:55 -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 DFE3B227372; Tue, 7 Jun 2022 12:00:47 -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 B3B84B8239B; Tue, 7 Jun 2022 19:00:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 30017C385A2; Tue, 7 Jun 2022 19:00:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654628445; bh=2ftzByvT7ollHRgAimUJKlQkYDooesMzSmrN5hTXnXs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hSRgaJTVZiY/xxNtSnwyGYGQD6FYchnDE1jvsWfsYrtA+hQKHJa6Qyy57L6VKZwuV W9VvnejOUGL84l67qYGar/3QInxBQVB43YK5fTNRTRZkn+5Q5L6K+lm+q56BtSp2q/ 1Nq/LcRrPs6FrDxkSeNiSzR81v7h7QNy2sfioXHM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , AngeloGioacchino Del Regno , Mark Brown , Sasha Levin Subject: [PATCH 5.18 282/879] ASoC: mediatek: Fix error handling in mt8173_max98090_dev_probe Date: Tue, 7 Jun 2022 18:56:40 +0200 Message-Id: <20220607165011.033619974@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 4f4e0454e226de3bf4efd7e7924d1edc571c52d5 ] Call of_node_put(platform_node) to avoid refcount leak in the error path. Fixes: 94319ba10eca ("ASoC: mediatek: Use platform_of_node for machine drivers") Fixes: 493433785df0 ("ASoC: mediatek: mt8173: fix device_node leak") Signed-off-by: Miaoqian Lin Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220404092903.26725-1-linmq006@gmail.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/mediatek/mt8173/mt8173-max98090.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sound/soc/mediatek/mt8173/mt8173-max98090.c b/sound/soc/mediatek/mt8173/mt8173-max98090.c index 4cb90da89262..58778cd2e61b 100644 --- a/sound/soc/mediatek/mt8173/mt8173-max98090.c +++ b/sound/soc/mediatek/mt8173/mt8173-max98090.c @@ -167,7 +167,8 @@ static int mt8173_max98090_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) @@ -179,6 +180,8 @@ static int mt8173_max98090_dev_probe(struct platform_device *pdev) ret = devm_snd_soc_register_card(&pdev->dev, card); of_node_put(codec_node); + +put_platform_node: of_node_put(platform_node); return ret; } -- 2.35.1