Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp31330pxb; Tue, 7 Sep 2021 16:52:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFqDKncMG+joM+n0cXL/616/OzMwJejCfqBybXjk7X2Z+8O64EQS6JksQ7QRCJDoC8wqUX X-Received: by 2002:a05:6602:130c:: with SMTP id h12mr683871iov.132.1631058748345; Tue, 07 Sep 2021 16:52:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631058748; cv=none; d=google.com; s=arc-20160816; b=Oe76w1U4UmvuxRYxn+I76Ej01xfLr99Vt3htP9mfmZTcuybKzhql1dw9c1NbUpo0WC 9sR/N/7rLvNZ4f7LiaI/vV+noSgUs7aaApe0yITQpOYVrfSHF9BQfZKt7uUTVDEXX3cJ lO+EWzPQzR0/EFcZOsFTZhs4uZ7Gh3xnfses6/RF+97lrLoICzeH2zsbmJqc9U7QRdlr 0ou4i6l9nWIGbkh6+8gdSyM7Jiz8g9r7qzpy5X8lgK82keib3cug91UU108TfwSu62Q+ HV6V7yDjmUVXQiZF7aYahg2v3jc4w1q+gDbuxe7WEQwz8iVndBHbBSDtnQix5mv0bqg3 DMog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=6C+UtyiW8etyIzvp1bSQYtwL6nt/zyAE4orGv5NIebE=; b=GA8IkAd9fHMrgy3KO3VZ8DLTPG9j8Hi2AvTW9V+LEW6wuFxf8xM/uBdUAcFCYb3nGI SWIaUeC+EPTGwGY1eTDedOv9YL890ZnkJ8KYYT2cGThmwzCfMjY7KLwD4/tET7FVZ7pz tRvQHd6QG/3tw4G0ROKDDekAnvpuhPKDMo/NOdc0H0vTSLNLliwGDT1rSGqbA+rwE7Kj uK1A8cbHzDNwW6d45h0C2OsYxcF0SmmQuSdWasnrDSsrr3DGisaMsrZM3t0c2hp6nBrk 0GgffoJtnh49rOPM1y+cXfBDz5A0bt2Bn49TSHHttC/Xqhonu8VNKMIfIYsOf6oQDo+X p2CQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=puMEaI8X; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i18si381352jan.99.2021.09.07.16.52.13; Tue, 07 Sep 2021 16:52:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=puMEaI8X; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347675AbhIGXTJ (ORCPT + 99 others); Tue, 7 Sep 2021 19:19:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238549AbhIGXTI (ORCPT ); Tue, 7 Sep 2021 19:19:08 -0400 Received: from mail-qv1-xf29.google.com (mail-qv1-xf29.google.com [IPv6:2607:f8b0:4864:20::f29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37C90C061575; Tue, 7 Sep 2021 16:18:01 -0700 (PDT) Received: by mail-qv1-xf29.google.com with SMTP id w9so153524qvs.12; Tue, 07 Sep 2021 16:18:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6C+UtyiW8etyIzvp1bSQYtwL6nt/zyAE4orGv5NIebE=; b=puMEaI8X9kp7QcnZkvnzMXidvJ8oGSkYKvYc/UV/g8KQlI424kmo1dJSCv3lm39c35 bn0OJMX3hL9Bg3gE/eOKrQWXmwT6E72nTOXHBSqrvdABa/K5y2a2GkIAtOehmWMHx7BH vldMocWf05mpZDnaDFKWCta5scmeM3rnytdbepdKd8641BxiQxDwYOa4TaaVQO5AZ40x 9/rnQ6KZZTM/Ug393WL0U1xznAkrnQchQixFgqYXF4TByQayfO5k9ytxozaf7V5qfUHq +I/s2as/yQah+8zBfwT2bsdhxbTNS3GQ7CCZ0mWkBWrxktvwjyPgZaEVVxkNYq73Ak95 bwHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6C+UtyiW8etyIzvp1bSQYtwL6nt/zyAE4orGv5NIebE=; b=h1MZNJh4MrtkMu/muLHNy246G2XFlr9GIrf7vIWw7qzJp9tu9Z43QvD0o9bSJ8TeBL CNfkiBJljImB1bwAjlSJexyYjKdJVVNooalByGGqW5JSaIbo7V19YHGymomtrV6mRUJh Eo8WNNrYL2pM4DwzCfWM7CvKNtZZnMoJYRyWNFf3DTu9Q9wcnIDtPfQP1SikMTvINmNO 8lsaGgqUPdXk+LVwhvcrU2+TOAaVUweZPLs9ncgkfGpZH18NJCN8H0fNAkOSDSp0fhrL AwrcwFKpbrqcv3fbJ5o+P5MWmVABow6fDc4ZvnMf0KBnoiVsotNYUM+EUElqbmiEJ+E1 kcpg== X-Gm-Message-State: AOAM530ocegckYRTjVOMAtmHoKwvUmiuIWicuawtRkPXPPtZ5iwJJQim B8c2hGyotawGXHUKKBrbgrqmWDtOiXxN4mVD3s8= X-Received: by 2002:a0c:e04a:: with SMTP id y10mr737242qvk.14.1631056680456; Tue, 07 Sep 2021 16:18:00 -0700 (PDT) MIME-Version: 1.0 References: <20210907085946.21694-1-vulab@iscas.ac.cn> <0fa7ddfa-cd65-583e-a83f-4cbcd4e7337f@linux.ibm.com> In-Reply-To: <0fa7ddfa-cd65-583e-a83f-4cbcd4e7337f@linux.ibm.com> From: "Oliver O'Halloran" Date: Wed, 8 Sep 2021 09:17:49 +1000 Message-ID: Subject: Re: [PATCH] pci/hotplug/pnv-php: Remove probable double put To: Tyrel Datwyler Cc: Xu Wang , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Bjorn Helgaas , linux-pci , linuxppc-dev , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 8, 2021 at 8:02 AM Tyrel Datwyler wrote: > > On 9/7/21 1:59 AM, Xu Wang wrote: > > Device node iterators put the previous value of the index variable, > > so an explicit put causes a double put. > > > > Signed-off-by: Xu Wang > > --- > > 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 04565162a449..ed4d1a2c3f22 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); > > Are you sure this is a double put? This looks to me like its meant to drive tear > down of the device by putting a long term reference and not the short term get > that is part of the iterator. Yeah, the put is there is to drop the initial ref so the node can be released. It might be worth adding a comment.