From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751396AbcBLH6K (ORCPT ); Fri, 12 Feb 2016 02:58:10 -0500 Received: from mail-wm0-f51.google.com ([74.125.82.51]:34785 "EHLO mail-wm0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751331AbcBLH6I convert rfc822-to-8bit (ORCPT ); Fri, 12 Feb 2016 02:58:08 -0500 Subject: Re: [PATCH v2] of: resolver: Add missing of_node_get and of_node_put Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\)) Content-Type: text/plain; charset=utf-8 From: Pantelis Antoniou In-Reply-To: Date: Fri, 12 Feb 2016 09:58:03 +0200 Cc: Amitoj Kaur Chawla , Frank Rowand , Grant Likely , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Julia Lawall Content-Transfer-Encoding: 8BIT Message-Id: References: <20160203180901.GA27874@amitoj-Inspiron-3542> To: Rob Herring X-Mailer: Apple Mail (2.3112) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Rob, > On Feb 12, 2016, at 01:18 , Rob Herring wrote: > > On Wed, Feb 3, 2016 at 12:09 PM, Amitoj Kaur Chawla > wrote: >> In __of_find_node_by_full_name, add an of_node_get when detecting the >> desired element, to ensure that it ends up with a reference count that is >> one greater than on entering the function. >> >> Also in __of_find_node_by_full_name, add an of_node_put on breaking >> out of the for_each_child_of_node loop, to ensure that the reference >> count of the returned value is not double incremented. This change >> was made using Coccinelle. > > Pantelis, are you convinced this is correct (albeit somewhat pointless)? > This is good enough. It’s a local method and we won’t ever try to use it outside of the resolver. We need to fix the reference counting properly sometime in the future. > Rob Regards — Pantelis