Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp6020319ybc; Wed, 27 Nov 2019 13:31:49 -0800 (PST) X-Google-Smtp-Source: APXvYqxSr4747TaXekwg4ckaThHIiKgQg8BbEMsTHC3+RhLtZvOeAfxVVaYpU8IopFPTVkBWdWfz X-Received: by 2002:aa7:d6c8:: with SMTP id x8mr4727887edr.300.1574890309234; Wed, 27 Nov 2019 13:31:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574890309; cv=none; d=google.com; s=arc-20160816; b=rJcHy7k695rZcl8J23MQYSqRMKrlz8BTgV0aGmsJPnuyrixdg/e0gpBuRKTY2ks0m6 sKgq42XIkPTfCe/+O94PCuFceg3kQfmfrAbcJmwiI0+quX9NGIWW6AjkYX06ZNWYoi+b dPi/uh/LPSU9NJKosh0sk6cmKYlKA6hUrWZCmhS5dJcuGeSWMHqIWPCFJsOgaWZwFLcT s+mnmOE+k5fYP+GVlCy0pRHh1Dw13RC8fydk6HvpEImcycPUnhOwebA+gWJB8dpMPLRs LhPGJRUDz9ZGLbfoTXsS7kwPaR/tiaAMlr/0KqjgD7dkc2Py4983s1edk+9oP3TXf8os rSow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=B1v8ICHlWyOe8zveOznideOS/T07HjGt3inTRaVRKpg=; b=lCdG4kN1IVzxdkeZmR7TbvnfYjjdwBs65KRUJmILEa5Dzx2ja8Gahi+hv02LmpmycT WZ4u9qiQJE4h+prvoHH9GGt6A+Lp31YJmh13f6Z9Cui5xTHwOnHhFk7kpaOKOLVR4M8B jjdjG9LXWykMMG0az05rna5frxwRW2xm2uxwCl8J5qmpV8QwtXOx063iBH/FraIdrzA5 TC+SVfaxVnKY9kod0dgY89yZD2mwM4nbga/361b51IO2J4KdWeKTG2suUK4rKDNJwAjM MTm67Qvr3BkOX4YEJ+Rddt6LOr3QPgPD0yPJ+jR6MoXupaBiy6QOU8Y8NMVHcN7EQ62Q iB/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Pj/2m3l0"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k23si10309926ejd.176.2019.11.27.13.31.26; Wed, 27 Nov 2019 13:31:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Pj/2m3l0"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731315AbfK0U60 (ORCPT + 99 others); Wed, 27 Nov 2019 15:58:26 -0500 Received: from mail.kernel.org ([198.145.29.99]:49678 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731310AbfK0U6Y (ORCPT ); Wed, 27 Nov 2019 15:58:24 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B77E12084D; Wed, 27 Nov 2019 20:58:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574888303; bh=AEKuXHxzOlWw1jjhUhJvnxQdyfazbBauDavrgiai+r0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Pj/2m3l0QxBTysdWH7xVbtq0tPF6lIDjUlkRnyYZF8E/qLgYgWExMum9uVHNNwL3r MU5A3/RqiwbLq6BI1DJwiHPo3J/z3+J/YvtW5UrzXnzUYSoYsLnyx3AvshGnD40nPi yUK+iaSCbmY5keX7hrkBX7Ul08f7h6cElBfbnmDA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marcel Ziswiler , Jon Hunter , Mark Brown , Sasha Levin Subject: [PATCH 4.19 081/306] ASoC: tegra_sgtl5000: fix device_node refcounting Date: Wed, 27 Nov 2019 21:28:51 +0100 Message-Id: <20191127203120.831691695@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127203114.766709977@linuxfoundation.org> References: <20191127203114.766709977@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marcel Ziswiler [ Upstream commit a85227da2dcc291b762c8482a505bc7d0d2d4b07 ] Similar to the following: commit 4321723648b0 ("ASoC: tegra_alc5632: fix device_node refcounting") commit 7c5dfd549617 ("ASoC: tegra: fix device_node refcounting") Signed-off-by: Marcel Ziswiler Acked-by: Jon Hunter Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/tegra/tegra_sgtl5000.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/sound/soc/tegra/tegra_sgtl5000.c b/sound/soc/tegra/tegra_sgtl5000.c index 45a4aa9d2a479..901457da25ec3 100644 --- a/sound/soc/tegra/tegra_sgtl5000.c +++ b/sound/soc/tegra/tegra_sgtl5000.c @@ -149,14 +149,14 @@ static int tegra_sgtl5000_driver_probe(struct platform_device *pdev) dev_err(&pdev->dev, "Property 'nvidia,i2s-controller' missing/invalid\n"); ret = -EINVAL; - goto err; + goto err_put_codec_of_node; } tegra_sgtl5000_dai.platform_of_node = tegra_sgtl5000_dai.cpu_of_node; ret = tegra_asoc_utils_init(&machine->util_data, &pdev->dev); if (ret) - goto err; + goto err_put_cpu_of_node; ret = snd_soc_register_card(card); if (ret) { @@ -169,6 +169,13 @@ static int tegra_sgtl5000_driver_probe(struct platform_device *pdev) err_fini_utils: tegra_asoc_utils_fini(&machine->util_data); +err_put_cpu_of_node: + of_node_put(tegra_sgtl5000_dai.cpu_of_node); + tegra_sgtl5000_dai.cpu_of_node = NULL; + tegra_sgtl5000_dai.platform_of_node = NULL; +err_put_codec_of_node: + of_node_put(tegra_sgtl5000_dai.codec_of_node); + tegra_sgtl5000_dai.codec_of_node = NULL; err: return ret; } @@ -183,6 +190,12 @@ static int tegra_sgtl5000_driver_remove(struct platform_device *pdev) tegra_asoc_utils_fini(&machine->util_data); + of_node_put(tegra_sgtl5000_dai.cpu_of_node); + tegra_sgtl5000_dai.cpu_of_node = NULL; + tegra_sgtl5000_dai.platform_of_node = NULL; + of_node_put(tegra_sgtl5000_dai.codec_of_node); + tegra_sgtl5000_dai.codec_of_node = NULL; + return ret; } -- 2.20.1