Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3694473pxb; Mon, 24 Jan 2022 15:34:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJwgRDk/R8cBYlL29HlvJtH3MdbJxWcr8e01o6kFZSXqZ3daV0tn8zsxCJQMI0Q/pRsoldm5 X-Received: by 2002:aa7:914a:0:b0:4c6:c181:5251 with SMTP id 10-20020aa7914a000000b004c6c1815251mr16179757pfi.41.1643067273953; Mon, 24 Jan 2022 15:34:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643067273; cv=none; d=google.com; s=arc-20160816; b=b1GgIBNMiVDOkoqC25Qady2pTgjWh6AbFBJ4pUWFydMleavieGgymEWT96KqTEQrG3 drbBxyjDVlk1L6WMfAl0j7Wmcafkubou4m2IEXLdIywbzsA+G8OG2MtCd4nd0DFhcSGD 6yK8IZCQp0j0vRJZW8aN/r2M7tFa60nM+KbK1JrtTYnkXWLgC0b+1ntoj8SHazhKTiRc HbevrIXSL27TiPJjxqbVSJQ//NvMX15ibb7m+8YglbVvsvpubcNq6C+82B3LnEvxOY5N Jh+nZkyVWXBVtbDr21whdJoSElf3ImrQq8hOX7H2wvvkF2fCp5y1wA0kloeXT7wN1+Mq yhbw== 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=GuBjEEvQZA4o+q6HcjC/eJ/dpEHiF7FoL/Tqnahd194=; b=moI+LhGPDCJL/6H+Uskp84Ermwh7UMCINrBwqJUBm/PH6O7ZMZ2ckNA6dG1Cu1uKOb bgwYi02DEA8/RFyPuU7hQ0x8X/4zIFTE02rWqkvaYYVG3LCi5IPMWiWd0cL9hb9OGHOp 1wVUHLVScU0xP6nngx21/VETOt5A6AzcvbWeTTqt7d6MYuN8MXI9FoSknxugKkduuJVI +XV0QiBmxK43o9xBcCmE5/POMe+JNlatbi4Uy2BZ5S98n3nVAKFEWKzBvQYO5dUR/2Tb BH44m2oBC+7qlNOer978pvgd3U/ZjhyRl2GIZCK83MntcVjnu5h68n0t+BFqXb1Dlbrb wggw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BaWPBnWh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u21si15675660plq.325.2022.01.24.15.34.20; Mon, 24 Jan 2022 15:34:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BaWPBnWh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1849449AbiAXXZx (ORCPT + 99 others); Mon, 24 Jan 2022 18:25:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1579859AbiAXWHP (ORCPT ); Mon, 24 Jan 2022 17:07:15 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 161FEC046E24; Mon, 24 Jan 2022 12:42:52 -0800 (PST) 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 84ED66152F; Mon, 24 Jan 2022 20:42:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4146AC340E5; Mon, 24 Jan 2022 20:42:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643056969; bh=hNiXVPwOVmy/4yBg5fl7XcRs2NLXgKTOlk9ADgTFuyA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BaWPBnWhXH1KsuUz3AhoV5ieOtnoBnvlaGeK1hSllQ/j/SPaga83SARsV4Z51UxQb ae6CwC2uhNtpO6a1DiP41rzQoxwcv13+e3CHeeuvHD824rXkPfZWadnOVRwS25O8s9 4yTHIHHm3wwwZt8rlAIN+KBlWBbUxgbyDdZTRswI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tzung-Bi Shih , Mark Brown , Sasha Levin Subject: [PATCH 5.15 660/846] ASoC: mediatek: mt8183: fix device_node leak Date: Mon, 24 Jan 2022 19:42:57 +0100 Message-Id: <20220124184123.828261609@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184100.867127425@linuxfoundation.org> References: <20220124184100.867127425@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tzung-Bi Shih [ Upstream commit cb006006fe6221f092fadaffd3f219288304c9ad ] Fixes the device_node leak. Signed-off-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20211224064719.2031210-3-tzungbi@google.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c | 6 +++++- sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c b/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c index a4d26a6fc8492..bda103211e0bd 100644 --- a/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c +++ b/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c @@ -781,7 +781,11 @@ static int mt8183_da7219_max98357_dev_probe(struct platform_device *pdev) return ret; } - return devm_snd_soc_register_card(&pdev->dev, card); + ret = devm_snd_soc_register_card(&pdev->dev, card); + + of_node_put(platform_node); + of_node_put(hdmi_codec); + return ret; } #ifdef CONFIG_OF diff --git a/sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c b/sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c index 94dcbd36c8697..c7b10c48c6c22 100644 --- a/sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c +++ b/sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c @@ -780,7 +780,12 @@ mt8183_mt6358_ts3a227_max98357_dev_probe(struct platform_device *pdev) __func__, ret); } - return devm_snd_soc_register_card(&pdev->dev, card); + ret = devm_snd_soc_register_card(&pdev->dev, card); + + of_node_put(platform_node); + of_node_put(ec_codec); + of_node_put(hdmi_codec); + return ret; } #ifdef CONFIG_OF -- 2.34.1