From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1869CC433F5 for ; Wed, 20 Oct 2021 16:54:34 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0CF8360FE8 for ; Wed, 20 Oct 2021 16:54:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0CF8360FE8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4HZGtH1Zbpz3c7L for ; Thu, 21 Oct 2021 03:54:31 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=cYPs5ja+; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linux.ibm.com (client-ip=148.163.158.5; helo=mx0b-001b2d01.pphosted.com; envelope-from=tyreld@linux.ibm.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=cYPs5ja+; dkim-atps=neutral Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4HZGsP0XjZz2yHJ for ; Thu, 21 Oct 2021 03:53:44 +1100 (AEDT) Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 19KGpfnw032728; Wed, 20 Oct 2021 12:53:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=8vwQcs16z4jwCBgDoO7eJaU97CZS5frolOclDq5kwQM=; b=cYPs5ja+2VgjGYzn9ST0U9QAW5pCsQuNmNOngZGHFDwtj2lS/Ggi+ro16xxl8ANuM8WR SmcH7QDh7G1OlGwW6jKA/A0SEZkcmgPzmT9YxLw6XW9ibrMsaBqZuQKMBNQL7n+Mg4uN LHrVBZbczbZ+kJC+AMfClnxN5myNvpKDXKyPZ0OdWYW4XJ/wtFpmxdb7JJsWWWZv3YSg ZaolDyPtLclqnwy7Zp+/T/0Ym6fJ+1zI7w7RUofq8CIht2O4x04IP3/5udgEruZcVDn+ eDHXhp81NiwSmoR9gKPB2nEJbYAdNO9UD4jVWGFW4o+3IdTR1m1YzzLnEu8retw+yDGr iw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3btpdqgvyc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 20 Oct 2021 12:53:36 -0400 Received: from m0098421.ppops.net (m0098421.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 19KGpnEb001224; Wed, 20 Oct 2021 12:53:35 -0400 Received: from ppma05wdc.us.ibm.com (1b.90.2fa9.ip4.static.sl-reverse.com [169.47.144.27]) by mx0a-001b2d01.pphosted.com with ESMTP id 3btpdqgvy4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 20 Oct 2021 12:53:35 -0400 Received: from pps.filterd (ppma05wdc.us.ibm.com [127.0.0.1]) by ppma05wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 19KGm6cD001505; Wed, 20 Oct 2021 16:53:34 GMT Received: from b03cxnp08027.gho.boulder.ibm.com (b03cxnp08027.gho.boulder.ibm.com [9.17.130.19]) by ppma05wdc.us.ibm.com with ESMTP id 3bqpcc9n3r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 20 Oct 2021 16:53:34 +0000 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 19KGrXlJ19530108 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Oct 2021 16:53:33 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DDF28C605A; Wed, 20 Oct 2021 16:53:33 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 35DBAC6065; Wed, 20 Oct 2021 16:53:32 +0000 (GMT) Received: from oc6857751186.ibm.com (unknown [9.65.235.71]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 20 Oct 2021 16:53:31 +0000 (GMT) Subject: Re: [PATCH] PCI/hotplug: Remove unneeded of_node_put() in pnv_php To: Wan Jiabing , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Bjorn Helgaas , linuxppc-dev@lists.ozlabs.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org References: <20211020094604.2106-1-wanjiabing@vivo.com> From: Tyrel Datwyler Message-ID: Date: Wed, 20 Oct 2021 09:53:31 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20211020094604.2106-1-wanjiabing@vivo.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: PeiGYbWmp4jpmLz3O0PIf88tPxZfXwoU X-Proofpoint-GUID: j5Tlcj0sjCBZ5VtaMprbvFchCNc5RVHl X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475 definitions=2021-10-20_05,2021-10-20_02,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 impostorscore=0 mlxscore=0 spamscore=0 clxscore=1011 priorityscore=1501 mlxlogscore=999 suspectscore=0 lowpriorityscore=0 bulkscore=0 adultscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109230001 definitions=main-2110200092 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kael_w@yeah.net Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On 10/20/21 2:46 AM, Wan Jiabing wrote: > Fix following coccicheck warning: > ./drivers/pci/hotplug/pnv_php.c:161:2-13: ERROR: probable double put. > > Device node iterators put the previous value of the index variable, so > an explicit put causes a double put. > > Signed-off-by: Wan Jiabing NACK This is a false positive from coccicheck. This is a case were a node is being dynamically removed and the long reference needs to be dropped. Otherwise, the reference count doesn't go to zero and trigger cleanup. This would result in us ending up in a leaked device node. -Tyrel > --- > drivers/pci/hotplug/pnv_php.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/drivers/pci/hotplug/pnv_php.c b/drivers/pci/hotplug/pnv_php.c > index f4c2e6e01be0..f3da4f95d73f 100644 > --- a/drivers/pci/hotplug/pnv_php.c > +++ b/drivers/pci/hotplug/pnv_php.c > @@ -158,7 +158,6 @@ static void pnv_php_detach_device_nodes(struct device_node *parent) > for_each_child_of_node(parent, dn) { > pnv_php_detach_device_nodes(dn); > > - of_node_put(dn); > of_detach_node(dn); > } > } >