linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 06/18] Make ft_node_add() accept and return NULL.
@ 2007-01-24 21:07 Scott Wood
  2007-01-24 21:48 ` Segher Boessenkool
  0 siblings, 1 reply; 6+ messages in thread
From: Scott Wood @ 2007-01-24 21:07 UTC (permalink / raw)
  To: linuxppc-dev

Currently, if ft_node_add() is passed NULL it will allocate an entry for
it and return a non-NULL phandle.  This patch makes it simply pass the
NULL through.

Signed-off-by: Scott Wood <scottwood@freescale.com>
---
 arch/powerpc/boot/flatdevtree.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/boot/flatdevtree.c b/arch/powerpc/boot/flatdevtree.c
index 78e179f..55b6699 100644
--- a/arch/powerpc/boot/flatdevtree.c
+++ b/arch/powerpc/boot/flatdevtree.c
@@ -40,6 +40,9 @@ static void *ft_node_add(struct ft_cxt *
 {
 	unsigned int i;
 
+	if (!node)
+		return NULL;
+
 	for (i = 1; i < cxt->nodes_used; i++)	/* already there? */
 		if (cxt->node_tbl[i] == node)
 			return (void *)i;
-- 
1.4.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-01-24 23:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-24 21:07 [PATCH 06/18] Make ft_node_add() accept and return NULL Scott Wood
2007-01-24 21:48 ` Segher Boessenkool
2007-01-24 22:02   ` Scott Wood
2007-01-24 22:30     ` Segher Boessenkool
2007-01-24 23:41       ` Scott Wood
2007-01-24 23:53         ` Segher Boessenkool

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).