Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5656903imm; Mon, 27 Aug 2018 01:44:18 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYpA6ATjkKrW4jvYfJ9Qx910KnWqAAQXaIUMdDlHrk3lQ6IEdNIO3l4IQDHisUY2klMJWi1 X-Received: by 2002:a17:902:981:: with SMTP id 1-v6mr12432995pln.229.1535359458078; Mon, 27 Aug 2018 01:44:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535359458; cv=none; d=google.com; s=arc-20160816; b=JHMWaHkChcmCoKs4Wf/hI5d+XVvNqumoYJHA4GpAPRwRJeRqnuc/UxZGQ8kGOEHdTz s9ffFKwJu3KpZW9oOMV1t/Vv60ZVs8YvDJx9cc4Um7nqUGHDysboT253r17mHcH8vok/ HEUeYNkkjocVH78EICrA4+tH4CGfAUAWT3DFH87tiV4507nU73weRJa77mBq268PxfHt +QvxOFIE56r7vnrKzSc977eFKMr5Fk01Mt+gfX64clyerdoxjq4fIzIv148zyK3ykwCO 7FQX71T+XrNu+Gv0uBbXfD0vvM7olqXaPoHPHvEDZ1NwTJ7VuSpmOZRb7b5INwXmadam boIA== 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:dkim-signature :arc-authentication-results; bh=u+twbXenaAT2Vsse6+ZkK10E0FHr6B3A7DzCymXimns=; b=UZ9Kv7wWcRU3fGgm8z1JBitgntqq9Ke6r7wFaU/gGS54rol9MujMQhTtgK+TO9ELVK 160SEPWq9xCL9XFknyyvEl9N3+WSwHCk/9o1vh9+NLtnO6rkkNXUNMcGglVAfT2LCBmd E33KjcNoaxh/v+rylfRUzHId/M8VDuRJ9hxH+kSkueUwn4FVLIWmiPRlLly8nMdX2dFW dnpRfLfT0lxN0YVmVmLi7+O7Cba3OD7U8LzDqIqn4a9sdyHP2mv/au0sW7pRTLdT6X3J pgatr9p/+c5e8G0WQw6z7UE7hepoPcpCQ893XzYR2BH0GvBCBe4hmFoLEoyK+w7xjdqE o/mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PfXbIqvz; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i128-v6si10234119pfg.93.2018.08.27.01.44.02; Mon, 27 Aug 2018 01:44:18 -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=pass header.i=@linaro.org header.s=google header.b=PfXbIqvz; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727065AbeH0M2e (ORCPT + 99 others); Mon, 27 Aug 2018 08:28:34 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:40456 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726802AbeH0M2d (ORCPT ); Mon, 27 Aug 2018 08:28:33 -0400 Received: by mail-wm0-f65.google.com with SMTP id 207-v6so7459426wme.5 for ; Mon, 27 Aug 2018 01:42:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=u+twbXenaAT2Vsse6+ZkK10E0FHr6B3A7DzCymXimns=; b=PfXbIqvzZz8uBYE6amh0oNA+HuzpMvTFLqR7CVfl2mxeN128lttTLNGzAh1TaOiN0B b3HQArPH54STX5CrI7Jlg/qEqyJ9jtIwgt54CXWi6lZIpVEppORFRh0C/iNsCnfX+7VG uOgFblkXJFZv7l0cn133H6pGrN/lcQxhqd5Kw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=u+twbXenaAT2Vsse6+ZkK10E0FHr6B3A7DzCymXimns=; b=jp5CgdwWQ1KSUfdKDzl+6HNVC/Zlt+Z/u10Y8mYCh1FX9SBZhrMo6CqGLp8QMrkmdU qPfV0aKZ2oCiNnTfeAu7wA2hEGwXjfxwjZZkbpoxW1oHV9hh7LwR8jWy984oR8srKv7N SjXoEFT6R6PvxG8lzWZIYQTfNZR65KtnpzM9pDpS3+zsE1RAkm/A/Wh79xusplG8iYYH QwBJCeEk2YfOlhHWRTxp/lHgkZ/VvOX2JfuieIldu0XsxRx/NLMI1gpBzcyUaGWGzhhe U7bHanQNsndvrYnSsFFgKVk84yHHYmrmpazeUd6SiCqfIJldqyuna7FsgGExk909vTAd V+iQ== X-Gm-Message-State: APzg51BMWjJbtb+QOWhQ2nqp7zrKCSJBJFyZlK4WuuspV0KkxtCTzG7j ZXmNm6SfrOgjERxsbJJJgwv15jMTjoE= X-Received: by 2002:a1c:398b:: with SMTP id g133-v6mr760281wma.5.1535359370183; Mon, 27 Aug 2018 01:42:50 -0700 (PDT) Received: from [192.168.0.22] (sju31-1-78-210-255-2.fbx.proxad.net. [78.210.255.2]) by smtp.googlemail.com with ESMTPSA id l24-v6sm29741257wrb.65.2018.08.27.01.42.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Aug 2018 01:42:49 -0700 (PDT) Subject: Re: [PATCH] drivers/thermal/tegra: fix a doule free devce node To: zhong jiang Cc: ezequiel@collabora.com, rui.zhang@intel.com, edubezval@gmail.com, jonathanh@nvidia.com, linux-kernel@vger.kernel.org References: <1533822056-33930-1-git-send-email-zhongjiang@huawei.com> <5B763226.1040609@huawei.com> From: Daniel Lezcano Message-ID: <469734c9-a79f-9207-303b-1a6713bede17@linaro.org> Date: Mon, 27 Aug 2018 10:42:45 +0200 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: <5B763226.1040609@huawei.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 17/08/2018 04:25, zhong jiang wrote: > On 2018/8/14 14:39, Daniel Lezcano wrote: >> On 09/08/2018 15:40, zhong jiang wrote: >>> Device node iterators will get the return node. Meawhile, It is >>> also put the previous device node. An explicit put will cause >>> a double put. >> What about: >> >> Subject: drivers/thermal/tegra: Fix a double free on the device node >> >> "The function 'for_each_child_of_node' iterates over the node list by >> dropping the of_node reference of the previous node. >> >> Calling of_node_put() on the iterator is pointless and leads to an >> inconsistent refcounting in addition to a double free. Remove it." > Hi, Daniel > > Have you picked up the patch or should I repost the patch with above commit > message that you have suggested? > > Thanks, > zhong jiang Hi, sorry for the delay. It is not up to me to pick patches for the thermal framework. You should repost the patch with the suggested commit log above if you agree with. -- Daniel >>> Signed-off-by: zhong jiang >>> --- >>> drivers/thermal/tegra/soctherm.c | 1 - >>> 1 file changed, 1 deletion(-) >>> >>> diff --git a/drivers/thermal/tegra/soctherm.c b/drivers/thermal/tegra/soctherm.c >>> index ed28110..3aa55c9 100644 >>> --- a/drivers/thermal/tegra/soctherm.c >>> +++ b/drivers/thermal/tegra/soctherm.c >>> @@ -980,7 +980,6 @@ static void soctherm_init_hw_throt_cdev(struct platform_device *pdev) >>> tcd = thermal_of_cooling_device_register(np_stcc, >>> (char *)name, ts, >>> &throt_cooling_ops); >>> - of_node_put(np_stcc); >>> if (IS_ERR_OR_NULL(tcd)) { >>> dev_err(dev, >>> "throttle-cfg: %s: failed to register cooling device\n", >>> >> > > -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog