Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp774501ybc; Sat, 16 Nov 2019 08:27:36 -0800 (PST) X-Google-Smtp-Source: APXvYqxU5t/0Zka8YsnYjVH/0KcGZlrxMpiFRL6orYNSI87tu9UB3PnQ9r9j3PJAjT0LNoutZeWm X-Received: by 2002:a17:906:4e99:: with SMTP id v25mr11161801eju.106.1573921656516; Sat, 16 Nov 2019 08:27:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573921656; cv=none; d=google.com; s=arc-20160816; b=puP7NG6Gsxu8GWrtnAA7Wyg3+/slJpQWWSswLTk5SBJxtYxsSW11ogkdPnhx0gQ/IH P0GlUa6/aTXl/MpF7Iga+rlgsa3l6SVg0LlBAEghN1pQMtrc1EcrJ7He8zlVmw1nBWNk ZjZcmkbf7h/mI5GpYbqoBXh0YL7bCQCpKLHcFc4aA6Hm3azOF7Mae4r3LI7oJcflxvsV hNxCo2YlPUV9mfMGh/uQ3JSe+K1R9WqBHDxKPacF0HDLmDvDsVJe100fM1sUuc7Fq/4C Vv10E2SjEMXxn2MX+oZlEYF+tu1rCaYtvvBbcE+RjwRMNNSZCAWsSBF2cYuAZe8TeOsz mknQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=B1v8ICHlWyOe8zveOznideOS/T07HjGt3inTRaVRKpg=; b=CDy4cZeRneXYFyjUc4fKAa5xth+Nqx0s6gCD/a/bSjBxLbL6HphtgGXzag91AsJCYZ yUaERABYen7Dtm2yBXVALMh1buOjHX1Gb7NyPVG9zzpA1SaAstQkhtb7rMR4yQ2wol1N rBZaD30QLMFcCNAq2KdRULPtqcvSIvgbv8bIAp3VQM93l3w1CkmNEuR20tmuqd8De23Y 26hASFgoQOzrEKV8aCs6JBd/ItmYmwhpU9yIW9UyS3ADcZTs+2Dx9qJWl+MPVieeb1R+ fUDwjRVzhsA7iV2qMvVSqhZuyiVOVfBYP0W1e5XwWCvpNpVHElX4DoRpKximlxaejFym gsnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pM3U4VlU; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z16si8506081edx.337.2019.11.16.08.27.12; Sat, 16 Nov 2019 08:27:36 -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=pM3U4VlU; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731251AbfKPQYt (ORCPT + 99 others); Sat, 16 Nov 2019 11:24:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:45872 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728266AbfKPPmU (ORCPT ); Sat, 16 Nov 2019 10:42:20 -0500 Received: from sasha-vm.mshome.net (unknown [50.234.116.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D778A2072D; Sat, 16 Nov 2019 15:42:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573918940; bh=AEKuXHxzOlWw1jjhUhJvnxQdyfazbBauDavrgiai+r0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pM3U4VlUblagR2RXpQHQaPHodkDMOo32UAwuSiKXyCv6Uld/cvr6Rd2kQy2M9F5tr /FTcnt3sXv2lpWK7e4BCkbb7gQTJW/nmio9Iekl1PkwVptkc0bqDK6dkZelJKGls/e wm5xyQ+Uy9K7LaUEHMvPcshOl+lNShiLV/vDL42A= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Marcel Ziswiler , Jon Hunter , Mark Brown , Sasha Levin , linux-tegra@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 062/237] ASoC: tegra_sgtl5000: fix device_node refcounting Date: Sat, 16 Nov 2019 10:38:17 -0500 Message-Id: <20191116154113.7417-62-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191116154113.7417-1-sashal@kernel.org> References: <20191116154113.7417-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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