From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752742AbbJLAQk (ORCPT ); Sun, 11 Oct 2015 20:16:40 -0400 Received: from kirsty.vergenet.net ([202.4.237.240]:60209 "EHLO kirsty.vergenet.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752451AbbJLAQi (ORCPT ); Sun, 11 Oct 2015 20:16:38 -0400 Date: Mon, 12 Oct 2015 09:16:34 +0900 From: Simon Horman To: Julia Lawall Cc: kernel-janitors@vger.kernel.org, Magnus Damm , Russell King , linux-sh@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Thomas Petazzoni , Andrew Lunn , Bjorn Helgaas , Jason Cooper Subject: Re: [PATCH 3/5] ARM: shmobile: R-Mobile: add missing of_node_put Message-ID: <20151012001634.GE20025@verge.net.au> References: <1444480254-14399-1-git-send-email-Julia.Lawall@lip6.fr> <1444480254-14399-4-git-send-email-Julia.Lawall@lip6.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1444480254-14399-4-git-send-email-Julia.Lawall@lip6.fr> Organisation: Horms Solutions Ltd. User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Oct 10, 2015 at 02:30:52PM +0200, Julia Lawall wrote: > for_each_child_of_node performs an of_node_get on each iteration, so > a break out of the loop requires an of_node_put. > > The semantic patch that fixes this problem is as follows > (http://coccinelle.lip6.fr): > > // > @@ > expression root,e; > local idexpression child; > @@ > > for_each_child_of_node(root, child) { > ... when != of_node_put(child) > when != e = child > ( > return child; > | > + of_node_put(child); > ? return ...; > ) > ... > } > // > > Signed-off-by: Julia Lawall Thanks, I have queued this up as a cleanup for v4.4.