Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751911AbcDOPeI (ORCPT ); Fri, 15 Apr 2016 11:34:08 -0400 Received: from hqemgate15.nvidia.com ([216.228.121.64]:7794 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751176AbcDOPeH (ORCPT ); Fri, 15 Apr 2016 11:34:07 -0400 X-PGP-Universal: processed; by hqnvupgp08.nvidia.com on Fri, 15 Apr 2016 08:32:15 -0700 Subject: Re: [PATCH] i2c: core: Add missing of_node_put() To: Vladimir Zapolskiy , Wolfram Sang References: <1460724191-12167-1-git-send-email-jonathanh@nvidia.com> <5711019E.9020304@mentor.com> CC: , From: Jon Hunter Message-ID: <571109E8.70005@nvidia.com> Date: Fri, 15 Apr 2016 16:34:00 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <5711019E.9020304@mentor.com> X-Originating-IP: [10.26.11.193] X-ClientProxiedBy: UKMAIL102.nvidia.com (10.26.138.15) To UKMAIL101.nvidia.com (10.26.138.13) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 470 Lines: 13 On 15/04/16 15:58, Vladimir Zapolskiy wrote: > On 15.04.2016 15:43, Jon Hunter wrote: >> for_each_available_child_of_node performs an of_node_get on each >> iteration, so of_node_put() must be called on each iteration once >> we are finished with the node pointer. > > This is wrong, embedded of_get_next_available_child() correctly decrements > ref counter of an examined node. Oh yes, sorry, I see that now. Sorry for the noise and mis-interpretation here :-( Jon