Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3687006imm; Mon, 30 Jul 2018 01:24:33 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcld6fUCTQBuFZF9A82zWHtyBKY055eo8c3ZpjloMsuNMqhOn3kDK3mJvZSOepd5A4CGx38 X-Received: by 2002:a17:902:8c84:: with SMTP id t4-v6mr15787368plo.100.1532939073243; Mon, 30 Jul 2018 01:24:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532939073; cv=none; d=google.com; s=arc-20160816; b=bbcI/C1SOBIXipLYir1vXeT/RutVMcKBgXreR6p10jI/0eTw7IgRD58tRPBQt6ZyMM Qx/lF+ibkoF1j5r+TuZa66T2VAqnCyVD4sO/4MUC/+dcEq0jL0P52h5Xd+P7RraLSj9I ORep/X4tvAB0/HZ16UrlL4aqiXiJbGanleMvDw7jJlm3OL/njh9u89P6d5hsSrncqZmG 1edgust0dYt3Ybp/ZE83mMZ3ZEODlM/kTG6QDjBkKvHzW6qVkYQZxeEimcvsMUR0ZzjU VlazMD2nkbQO4BfitWytb5KyfYwac6SfaaNKnf9XwsCAfi+6Iv9PSYeOIqnSwg4NOM8f 7QHA== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=VtjiZOf3xDWR/GbjRvsysGeCAV/1PpsIIoLEwxlvnGw=; b=dFG1oiiUc+kpEwVJ+LMHxEX+S9G/+JXdGCu6GVP8ZBL/bwe8ciFLRd9UzSejXpcWbj V30Wunvasjhi8dVjv3oGM6GNba8yZ6iVoj9syQQrqLpJJW9+jIbce5TSFXzW007WIrex Cz0rMOxmgsyuyNCDzzLn42LEqvTRsLyMdWpSgE+oE2aEdBqcA3CroPEatPyyT3bmAfcs U9ApD83vNWkCv1IyA1/uFkWMX/3VKiy8LPXzsztT8/EvQIBolVScTUqlGymZDWt2o0WT ZUr4+L00sXwtbUfwsgjQnvIoU2FToiuoOurOgx5R6s3DOwZ2aWH8gcikta5SWurLT/oR G//Q== ARC-Authentication-Results: i=1; mx.google.com; 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=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g184-v6si10619866pfc.115.2018.07.30.01.24.16; Mon, 30 Jul 2018 01:24:33 -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; 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=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726593AbeG3J5J (ORCPT + 99 others); Mon, 30 Jul 2018 05:57:09 -0400 Received: from hqemgate16.nvidia.com ([216.228.121.65]:16499 "EHLO hqemgate16.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726487AbeG3J5J (ORCPT ); Mon, 30 Jul 2018 05:57:09 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate16.nvidia.com (using TLS: TLSv1, AES128-SHA) id ; Mon, 30 Jul 2018 01:23:05 -0700 Received: from HQMAIL101.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Mon, 30 Jul 2018 01:23:17 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Mon, 30 Jul 2018 01:23:17 -0700 Received: from [10.21.132.122] (172.20.13.39) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Mon, 30 Jul 2018 08:23:15 +0000 Subject: Re: [PATCH] ASoC: tegra_alc5632: fix device_node refcounting To: Alexey Khoroshilov , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai CC: , , References: <1532725619-8775-1-git-send-email-khoroshilov@ispras.ru> From: Jon Hunter Message-ID: <8a58db40-13c8-eaf1-85a0-bf6da8224997@nvidia.com> Date: Mon, 30 Jul 2018 09:23:13 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <1532725619-8775-1-git-send-email-khoroshilov@ispras.ru> X-Originating-IP: [172.20.13.39] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To HQMAIL101.nvidia.com (172.20.187.10) Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 27/07/18 22:06, Alexey Khoroshilov wrote: > 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 > --- > sound/soc/tegra/tegra_alc5632.c | 17 +++++++++++++++-- > 1 file changed, 15 insertions(+), 2 deletions(-) > > 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; > } Thanks! Acked-by: Jon Hunter Cheers Jon -- nvpublic