Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3643475imm; Mon, 30 Jul 2018 00:27:40 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdGYvZqByt4bHQX91gPL0HzL9lubA8SEQ43/50Uhpn+gAGKecU/fHykBWX7SSs2CIsTaJpe X-Received: by 2002:a63:4a61:: with SMTP id j33-v6mr15308209pgl.436.1532935660027; Mon, 30 Jul 2018 00:27:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532935660; cv=none; d=google.com; s=arc-20160816; b=Z4MflFstzOiRzRQXznvu/Hsr/yVMIAHWlnYnHwtfJZpHxsL1lhqHpyFOjXNdLi3fov zxlRo7+Ch9lT4bdDdaZ399RYL8y610ogwOv9kvZhURwGb7ZJn/jKARy40c3y6uEPUvq3 7lsIRtiJFKTNhZIR1CqbGNzzV0C9qB+1+nuNgEvrdHGmmtUnhZGdbBDOyzdJtpmpFbFy HnJFpDBpiBzMPMNMzPFJEAc8FzKS7NX3+FBD1XLyQ7CoIFMMCl/5z/qAe1pAOJnjCRvg 9NurT8bJLZh5MyJF62B/uqaZVleH9PSaf5Ylz+JeIbm4SXL+Jjdg8BD2GEyJLzQaWrak Ms7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=s/BwxklgWzJg/JjHOJjIdp+yKpDJiJgjVl+0KSoly4s=; b=yg4hSv7QzUAQeR4djkDgZ03MpCvxHBs682uHT8BZ8x8SRUPmoUX///XcGPPPaZGqZx BCDKZPPtaOhzcBaBSEk5ioLmXzIQKlORnY4toudXai7z2G2M2idiX1TzqV/ZOr/ATbpE pH1Dm/YezXOf43SdlA4xzJYH8+3jMisNIDTr8ZuuYkkBPPIUujEaOG7vDK1gh61ojaok UUbC7nrUQeSPreg4JNwYmBw/egGMe0TqdooKmG1XdrcfGT9HjlxlQ6LDmHKPz58oFAHk PlflzU/nJXwl+cun5s10Qr+0yLO+Xj9bL/wW4/8WJXPm4s5rmUyErJMBVcI8BAqkoQcr UzDg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p84-v6si11096486pfl.17.2018.07.30.00.27.25; Mon, 30 Jul 2018 00:27:39 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726593AbeG3I7W (ORCPT + 99 others); Mon, 30 Jul 2018 04:59:22 -0400 Received: from mout01.posteo.de ([185.67.36.141]:40744 "EHLO mout01.posteo.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726210AbeG3I7W (ORCPT ); Mon, 30 Jul 2018 04:59:22 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 2A16F2102E for ; Mon, 30 Jul 2018 09:25:43 +0200 (CEST) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 41fB1d4mnJz6tm6; Mon, 30 Jul 2018 09:25:41 +0200 (CEST) Date: Mon, 30 Jul 2018 09:25:15 +0200 (CEST) From: Marc Dietrich X-X-Sender: lucile@macbook-pro.fritz.box To: Alexey Khoroshilov cc: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, ldv-project@linuxtesting.org Subject: Re: [PATCH] ASoC: tegra_alc5632: fix device_node refcounting In-Reply-To: <1532725619-8775-1-git-send-email-khoroshilov@ispras.ru> Message-ID: References: <1532725619-8775-1-git-send-email-khoroshilov@ispras.ru> User-Agent: Alpine 2.21 (OSX 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Alexey, AFAICT, this looks right. It seems that *most* of the machine drivers (not only tegra) forget to decrease the refcount. I'm wondering why you didn't sent a series patch to fix them all at once? Reviewed-by: Marc Dietrich Marc On Sat, 28 Jul 2018, 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; > } > > -- > 2.7.4 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-tegra" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >