From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jOHdA-0002cj-E7 for barebox@lists.infradead.org; Tue, 14 Apr 2020 09:13:21 +0000 Date: Tue, 14 Apr 2020 11:13:18 +0200 From: Sascha Hauer Message-ID: <20200414091318.GZ27288@pengutronix.de> References: <20200414090610.9119-1-m.tretter@pengutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200414090610.9119-1-m.tretter@pengutronix.de> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: Re: [PATCH] of: use of_get_child_by_name() to find child node To: Michael Tretter Cc: barebox@lists.infradead.org, Ahmad Fatoum On Tue, Apr 14, 2020 at 11:06:10AM +0200, Michael Tretter wrote: > After iterating the children of a node with for_each_child_of_node(), > the child node will never be NULL. If the node was not found, > overlay_child will always point to the first element in the list, which > might or might not be the node that was searched. > > Use the of_get_child_by_name() helper function to find the child node > with the name, which does the right thing and returns NULL if the node > is not found. > > Reported-by: Ahmad Fatoum > Signed-off-by: Michael Tretter > --- > drivers/of/resolver.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) Applied, thanks Sascha -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox