From patchwork Mon Jun 18 11:59:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 930817 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-tegra-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=sirena.org.uk header.i=@sirena.org.uk header.b="TiXyfT+u"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 418VBf2TcVz9ry1 for ; Mon, 18 Jun 2018 22:04:26 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934657AbeFRMAH (ORCPT ); Mon, 18 Jun 2018 08:00:07 -0400 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:45030 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933079AbeFRMAE (ORCPT ); Mon, 18 Jun 2018 08:00:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=RLdO7RY++Gu9dx/E7EPnh5iQbWr74N+Mo9/ZrEBnH0U=; b=TiXyfT+u1CpS EaC17B93tAMYXqOKymapJ+t02LJDpoHqV7qTTN3vClmf0j5iDJ83njdLAN2Ag4Gc7r2D+35UtKyYq cvC5XHE5Q5TjIxI0mx2UVSSamzm8uZhsT37R6VPsatNLfaYKIx993Q2wh9iXgxp3kU0q2TGSgts0C BXyDs=; Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1fUsov-0007vw-0t; Mon, 18 Jun 2018 11:59:41 +0000 Received: from broonie by debutante with local (Exim 4.91) (envelope-from ) id 1fUsot-0008Lr-UI; Mon, 18 Jun 2018 12:59:39 +0100 From: Mark Brown To: Alexey Khoroshilov Cc: Mark Brown , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , ldv-project@linuxtesting.org, alsa-devel@alsa-project.org, sil2review@lists.osadl.org, linux-kernel@vger.kernel.org, Julia Lawall , linux-tegra@vger.kernel.org, alsa-devel@alsa-project.org Subject: Applied "ASoC: tegra: fix device_node refcounting" to the asoc tree In-Reply-To: <1529101378-5543-1-git-send-email-khoroshilov@ispras.ru> Message-Id: Date: Mon, 18 Jun 2018 12:59:39 +0100 Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org The patch ASoC: tegra: fix device_node refcounting has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark From 7c5dfd549617b87db8e891ff4ecaa4a582b6c4cc Mon Sep 17 00:00:00 2001 From: Alexey Khoroshilov Date: Sat, 16 Jun 2018 01:22:58 +0300 Subject: [PATCH] ASoC: tegra: fix device_node refcounting tegra_rt5677_probe() gets a couple of device nodes with of_parse_phandle(), but there is no release of them. The patch adds the release to tegra_rt5677_remove() and to error handling paths in the probe. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov Reviewed-by: Nicholas Mc Guire Signed-off-by: Mark Brown --- sound/soc/tegra/tegra_rt5677.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/sound/soc/tegra/tegra_rt5677.c b/sound/soc/tegra/tegra_rt5677.c index 0e4805c7b4ca..7081f15302cc 100644 --- a/sound/soc/tegra/tegra_rt5677.c +++ b/sound/soc/tegra/tegra_rt5677.c @@ -264,13 +264,13 @@ static int tegra_rt5677_probe(struct platform_device *pdev) dev_err(&pdev->dev, "Property 'nvidia,i2s-controller' missing or invalid\n"); ret = -EINVAL; - goto err; + goto err_put_codec_of_node; } tegra_rt5677_dai.platform_of_node = tegra_rt5677_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) { @@ -283,6 +283,13 @@ static int tegra_rt5677_probe(struct platform_device *pdev) err_fini_utils: tegra_asoc_utils_fini(&machine->util_data); +err_put_cpu_of_node: + of_node_put(tegra_rt5677_dai.cpu_of_node); + tegra_rt5677_dai.cpu_of_node = NULL; + tegra_rt5677_dai.platform_of_node = NULL; +err_put_codec_of_node: + of_node_put(tegra_rt5677_dai.codec_of_node); + tegra_rt5677_dai.codec_of_node = NULL; err: return ret; } @@ -296,6 +303,12 @@ static int tegra_rt5677_remove(struct platform_device *pdev) tegra_asoc_utils_fini(&machine->util_data); + tegra_rt5677_dai.platform_of_node = NULL; + of_node_put(tegra_rt5677_dai.codec_of_node); + tegra_rt5677_dai.codec_of_node = NULL; + of_node_put(tegra_rt5677_dai.cpu_of_node); + tegra_rt5677_dai.cpu_of_node = NULL; + return 0; }