Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp441279iog; Mon, 13 Jun 2022 06:04:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzW9WwNvAB7wWvaGTYog8Vp2X1xPMsXlVZtz/H2oAh3FCk4fmK1DEbu+jXDbGz1z0Jqipnm X-Received: by 2002:a17:906:a186:b0:6fe:8a06:849b with SMTP id s6-20020a170906a18600b006fe8a06849bmr51799429ejy.635.1655125399538; Mon, 13 Jun 2022 06:03:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655125399; cv=none; d=google.com; s=arc-20160816; b=TA5M4P4FG7j9s8qtPyHBbXjjd+FV2OcEjWfexBSPChecYI2GA0k36iSCNysTihK4ac 1qqjJBEO3A/1KgBw8oGA5vxxXSIljRNKObRGN21iCvM+jnibg+mZA/51lwiJxSw9HkzA JN4EftYA9ZxvdZ2cCv29RhSYAt6g4tjLqVy5hqscGi9BhdbkV5w0+z4cCBtkNqWvb4Xd by9GzG/VxqAcKpq2IRi/eR+ILh6wUxgbeVIrYc00B7qpiuSCgmpSmFg2wKVFUc2L/XdB xGG8z/Q6nfL0dDC4SqJv/73KEUbaeTfIto01djD4muHlsSa2mKds8XNaAjtulQ4y0CzU Ja5A== 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=/uWsx5bjulGhjZ01FVP6045XpeGoEQjBjRrEIHS1l4w=; b=Bck7woSdjdkkkidPAcTefv21gHTUlGLHBPwmzJt0BKk9vELjrV8uBna50VMOM3VZpn 7Jyo7BVqSFBNYw6y6vHBsHRY4neeMUiu9oEXakCDVZz15Ej/8rQsIAZse1X9Mhxx4sCz RtByqt0YdHVP9ezF9BfNCVAzBfLFyP2ScCVVKRvzSr3CwXn92gTJpahc7ng9N2fnoMis K1S8EbmvfLbGt1oyDmPS6XeHS7ljG1RiPlgym5Tm6j3zGYSrL5h1oV6AhqeAFnVQNfcL fgrmCiwGOLr4ofIDghCYGeDVkIcbRyYesasNeSEsY0W3T00Vr7g+00kTWh+S6N4uylTz ULOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tGfsKZjg; 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 bm20-20020a170906c05400b006ff03c95069si7305791ejb.575.2022.06.13.06.02.51; Mon, 13 Jun 2022 06:03:19 -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=tGfsKZjg; 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 S244224AbiFMKmJ (ORCPT + 99 others); Mon, 13 Jun 2022 06:42:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348600AbiFMKjr (ORCPT ); Mon, 13 Jun 2022 06:39:47 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49B0DD124; Mon, 13 Jun 2022 03:23:30 -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 DB4DD60AEA; Mon, 13 Jun 2022 10:23:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EC89FC34114; Mon, 13 Jun 2022 10:23:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655115809; bh=W47R0Y0VdUVQGgDibTon4iAYDCkW4SHGnYM3JEBBGC0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tGfsKZjgTzkGDyEZCwNgZ90PhRkSQjSK+O7JgkovKh9EUv+qkzxdR+f3mb+4RdfiN STagV1yRW1GPuKYLN5HPDM2hOF0nwsjeD+I4A8qLQnXY7k6KBPi4yYDKeuC3K7c7an rrlNiUkIT3E4VqrmoRtYC7qLNizCSdhlEnExu3RA= 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 4.14 049/218] ASoC: mediatek: Fix error handling in mt8173_max98090_dev_probe Date: Mon, 13 Jun 2022 12:08:27 +0200 Message-Id: <20220613094920.020575287@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094908.257446132@linuxfoundation.org> References: <20220613094908.257446132@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=-8.3 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 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 0adb7ded61e9..0f460bc77f47 100644 --- a/sound/soc/mediatek/mt8173/mt8173-max98090.c +++ b/sound/soc/mediatek/mt8173/mt8173-max98090.c @@ -164,7 +164,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 (i = 0; i < card->num_links; i++) { if (mt8173_max98090_dais[i].codec_name) @@ -179,6 +180,8 @@ static int mt8173_max98090_dev_probe(struct platform_device *pdev) __func__, ret); of_node_put(codec_node); + +put_platform_node: of_node_put(platform_node); return ret; } -- 2.35.1