Received: by 2002:a4a:311b:0:0:0:0:0 with SMTP id k27-v6csp4075541ooa; Tue, 14 Aug 2018 00:16:35 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyjAhmhtTi25eWEKi+bEag/fXBKNvkhatXRzV8HhX83UXCKRov3HrTeQxQgtmX6JYTpKAjX X-Received: by 2002:a63:d401:: with SMTP id a1-v6mr19719046pgh.414.1534230995773; Tue, 14 Aug 2018 00:16:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534230995; cv=none; d=google.com; s=arc-20160816; b=XqSU9qjheMKrkr8J6zegkxuTl1FjlcRwMmdI3lzXYBK9ax3BKKm2WC9whRgpKH7bFD sgkqA9sF+TB4if5HvmtW9/2lEqLFVLjzdKK2Dxf4JewPLy7nzHiYOh8UqP1sDMrNyHWF KbCLW+VE28e8dx4vxvAqDL1OpyTv8mgm/+ogcWyjbBq/VdhXUDmgQsVYx5F7ytt7oggx 5FtmbLx70FC8Idn5mPNx74yePbhMhMtiW6N1z7lJCBeNA7FpWy/jFQpsE8WDcfKlcZwj 8dnW72CqfD5Axm4OUouKjzk3szKbsF6OcOmitnlgnREvnSV78TJGBNZIW2Jw2GW7sBMx LDXg== 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:in-reply-to :references:subject:cc:to:mime-version:user-agent:from:date :message-id:arc-authentication-results; bh=MLgySYeqnGZUo3yGLkN1vm888d6iwT6CcMsaB9x1yEk=; b=h3i9wZisTb1qxbm8IYAqWZaw2uAn7ztLuM/nf+jo4wXlb1iDEIoMCjdjWuEX27as/U fZQesphezETVuUDL4cgSo7hMxdDsXIe7ZGIrOpG8om75vXk/GASfG9BNXA5azDMXao+f lfbE/87qDtV4W+T6Zm/fd9TJSPGgBoA4DOTnvwF1sh9E1MNn6ciHTf6nDKenON/6vBcX 3VAaRbQVc/v7/rb6RcOCM/QMfymDoNlPKgTjg6D0bG9QnyJEly9HeOyssfexNZLgOq++ uKZtAWD0L+avx9+wBqjatnCNHrd9PNtzIcq05Qrmtm9xY3FC1nzzN5EfbU3qO/mowROK zVXA== 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 s17-v6si16886219pge.99.2018.08.14.00.16.07; Tue, 14 Aug 2018 00:16:35 -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 S1731828AbeHNJmm (ORCPT + 99 others); Tue, 14 Aug 2018 05:42:42 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:33542 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727670AbeHNJml (ORCPT ); Tue, 14 Aug 2018 05:42:41 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 2DB64F3355229; Tue, 14 Aug 2018 14:56:50 +0800 (CST) Received: from [127.0.0.1] (10.177.29.68) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.399.0; Tue, 14 Aug 2018 14:56:49 +0800 Message-ID: <5B727D30.1050007@huawei.com> Date: Tue, 14 Aug 2018 14:56:48 +0800 From: zhong jiang User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Daniel Lezcano CC: , , , , Subject: Re: [PATCH] drivers/thermal/tegra: fix a doule free devce node References: <1533822056-33930-1-git-send-email-zhongjiang@huawei.com> In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.29.68] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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." Thank you for doing this. I am sorry for stupid issue. Sincerely, zhong jiang >> 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", >> >