Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3840445imm; Mon, 18 Jun 2018 05:06:07 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJeYsBEbjlVeJr+E/QGlMDx1y/CqfEdijIn+kBMU5EanpKmnEGoRNzDEbzjwVi1EQi4vdHZ X-Received: by 2002:a17:902:6847:: with SMTP id f7-v6mr13742389pln.173.1529323567079; Mon, 18 Jun 2018 05:06:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529323567; cv=none; d=google.com; s=arc-20160816; b=A4/6Mz3YJwB/R5kTJLRUJPi/wANb7dc2BK6Km6fLS3F40SDxDWzstKVu32Mvc/is4P z4ZyJbqa9BYrQeoNuLo2BWFI2jLyyTtBZsNekpNPBgqJuef5hKYPuPlHPWWYH7pLsSsK P7t4Up/F6Vu74QuUpLzv/ouPdNRK4PBe9Te++JbjCaF9NPJpna6t1u4KqVQd0XgAlBeH 2FrkvmydjkONJfcpP2hlg4a3GBYDbrJaLHqgxM3f0JFpPceYdfErIDYttjILGudPrVMO U5CEdShSMM9mIEVnrqfqDK1h8noatzSx2Xb+FQIUGJ5v6hK7BCBMmUH3K4kQfPwroERI 95DQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:in-reply-to:subject:cc:to :from:dkim-signature:arc-authentication-results; bh=RLdO7RY++Gu9dx/E7EPnh5iQbWr74N+Mo9/ZrEBnH0U=; b=rEyxoHoI/th+xF21K+6Q05n7IwWwSVNZmI40IW8TDOitDdBZSsSywEWtIMH0dB99Ke x+8KMKSQilOE3G1KTAOIiV6v/SR9VZMSLBbBUyh09iBI2qBsn5wYxJc2nqvMqtHzoLCb pyCL2ju1psKyE0XeQa4LMofwee1F+6GAn4VtxC5dtjAnK4j743MOz4PwtbgFMRiFetFG UqQFOx/9C/IOr9nKdI+FLXgcqQ/ZVZohNltBKimVthEGBh/cAdLzyO0ZsggU63epNWmS 2Eyn5cNVSwBpxWmDyVKAAs2hGDwizvClfESwiYD+15OQz2LfYb+KiLHp9QvJ0RS2OM6U kQJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=TiXyfT+u; 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=fail (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 g4-v6si14766372pfm.365.2018.06.18.05.05.52; Mon, 18 Jun 2018 05:06:07 -0700 (PDT) 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=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=TiXyfT+u; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934696AbeFRMAI (ORCPT + 99 others); Mon, 18 Jun 2018 08:00:08 -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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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; } -- 2.17.1