From patchwork Mon Jul 30 11:03:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 143125 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp3933249ljj; Mon, 30 Jul 2018 04:03:37 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdtJR5fek3KjR8NqOh3QU+sYozQYPw8L05up2vTA0vDPxEJl9tr7ns9Bip7jv9cfv54jxB0 X-Received: by 2002:a5d:6550:: with SMTP id z16-v6mr17203333wrv.194.1532948617946; Mon, 30 Jul 2018 04:03:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532948617; cv=none; d=google.com; s=arc-20160816; b=lXA4W9l1dUw9UX8w8KhXWdoCWGYta4AQC1g9TsxirMHGkG8o2yPBqkgdP/yoM6VCPW GevZqgu71B7DRzX8lijaJ5cOUam8aJpi6wehTd3nxujV/PYgnRKh8EtPmpagQKtwN2zt lbO4iYDDGiHvOgyzy59rimh1BVUo62NwfHJH7H2fsh2DikxU1dudM6grfuRlNm5/i40R v8Bm4JzwGIpT52HITdyoUkUXKkJaifV6Xc/8KCH5pv3/uVhoT4vg9tyjabzIeFVmtUav xX1ANK6wxSztbDaNvynUWmkGDBAGBYXTXBufv3mwH0LTHIX8ujYaqrp/DGiwCXZHLXHc jKYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:date:message-id:in-reply-to:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=1u5lBQHpuW21xbSEpV3OxZETog9mUuy0twJmUatVpEo=; b=gbaZmPw0JGWK6USqvkh+jwdCwDvKN+tilBdR9R5hohJ3+roBjJfGhRM6GboTWOfJZr b9jzL2fZlZFTioDvkqvhjEscK7Y98XNmX1/MeOW6SsM8nTgHkcfmVkbTHDXFeRTj7J0b 6jOivWwRiZY5cQ6bCBJenCCoDpH3WF7X8UqhuzHthI9i4CAXAGcV/ffqivbswxXaZ9OO dSLINEGJrzKYY6rjl/2bMZCuqStIk9wk9UPP4CYkODnu1FojK7GFTqr7r/nkacTX0c0D mzCsJOGbXf3H/8MMQR2eLYnqpzwpqmrTMhpDs1A8QFXurETPVHThLQsXPCJUTZB41VMB c2dA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b="V/ZNgVlN"; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id r14-v6si3000761wrg.106.2018.07.30.04.03.37; Mon, 30 Jul 2018 04:03:37 -0700 (PDT) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b="V/ZNgVlN"; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id F27482677BB; Mon, 30 Jul 2018 13:03:34 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 6EB512677BC; Mon, 30 Jul 2018 13:03:33 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=disabled version=3.4.0 Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [172.104.155.198]) by alsa0.perex.cz (Postfix) with ESMTP id 9CC852677BA for ; Mon, 30 Jul 2018 13:03:31 +0200 (CEST) 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=wC5xVV2m8+kkFidvny5WwyYNg+AJRPTfu2YKIs2z3B4=; b=V/ZNgVlNdwMR eHdAYSF68y2E/IPkC6ZX1iy5eiN/fHMVtvSOIZ6hfs4+2t1CldZyLqz9LcBtmmn3N4SNyIoLYziDb GjJv8DkV2OxEMN3YZ3AmsU2KbeGfN8n6f6WgM2zTY5+SLeEpGtGvh26NOTWUbDKpxMsf8DPqiNaOv YDm/s=; Received: from cpc102320-sgyl38-2-0-cust46.18-2.cable.virginm.net ([82.37.168.47] helo=debutante.sirena.org.uk) by heliosphere.sirena.org.uk with esmtpa (Exim 4.89) (envelope-from ) id 1fk5xa-000542-Ro; Mon, 30 Jul 2018 11:03:30 +0000 Received: by debutante.sirena.org.uk (Postfix, from userid 1000) id 9BF2C1124216; Mon, 30 Jul 2018 12:03:30 +0100 (BST) From: Mark Brown To: Alexey Khoroshilov In-Reply-To: Message-Id: <20180730110330.9BF2C1124216@debutante.sirena.org.uk> Date: Mon, 30 Jul 2018 12:03:30 +0100 (BST) Cc: alsa-devel@alsa-project.org, Mark Brown , Jon Hunter Subject: [alsa-devel] Applied "ASoC: tegra_alc5632: fix device_node refcounting" to the asoc tree X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org The patch ASoC: tegra_alc5632: 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 4321723648b0abb456f7a9af51bb09a4ec60799d Mon Sep 17 00:00:00 2001 From: Alexey Khoroshilov Date: Sat, 28 Jul 2018 00:06:59 +0300 Subject: [PATCH] ASoC: tegra_alc5632: fix device_node refcounting tegra_alc5632_probe() increments reference count of device nodes with of_parse_phandle(), but there is no code decrementing them in the driver. The patch adds of_node_put() to tegra_alc5632_remove() and to error handling paths in the probe. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov Acked-by: Jon Hunter Signed-off-by: Mark Brown --- sound/soc/tegra/tegra_alc5632.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) -- 2.18.0 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/tegra/tegra_alc5632.c b/sound/soc/tegra/tegra_alc5632.c index 5197d6b18cb6..98d87801d57a 100644 --- a/sound/soc/tegra/tegra_alc5632.c +++ b/sound/soc/tegra/tegra_alc5632.c @@ -190,14 +190,14 @@ static int tegra_alc5632_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_alc5632_dai.platform_of_node = tegra_alc5632_dai.cpu_of_node; ret = tegra_asoc_utils_init(&alc5632->util_data, &pdev->dev); if (ret) - goto err; + goto err_put_cpu_of_node; ret = snd_soc_register_card(card); if (ret) { @@ -210,6 +210,13 @@ static int tegra_alc5632_probe(struct platform_device *pdev) err_fini_utils: tegra_asoc_utils_fini(&alc5632->util_data); +err_put_cpu_of_node: + of_node_put(tegra_alc5632_dai.cpu_of_node); + tegra_alc5632_dai.cpu_of_node = NULL; + tegra_alc5632_dai.platform_of_node = NULL; +err_put_codec_of_node: + of_node_put(tegra_alc5632_dai.codec_of_node); + tegra_alc5632_dai.codec_of_node = NULL; err: return ret; } @@ -223,6 +230,12 @@ static int tegra_alc5632_remove(struct platform_device *pdev) tegra_asoc_utils_fini(&machine->util_data); + of_node_put(tegra_alc5632_dai.cpu_of_node); + tegra_alc5632_dai.cpu_of_node = NULL; + tegra_alc5632_dai.platform_of_node = NULL; + of_node_put(tegra_alc5632_dai.codec_of_node); + tegra_alc5632_dai.codec_of_node = NULL; + return 0; }