[PATCH 06/19] bootwrapper: Make ft_get_phandle() accept and return NULL.

Scott Wood scottwood at freescale.com
Thu Feb 8 10:01:25 EST 2007


Currently, if ft_get_phandle() 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 at 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 971420a..6c18773 100644
--- a/arch/powerpc/boot/flatdevtree.c
+++ b/arch/powerpc/boot/flatdevtree.c
@@ -40,6 +40,9 @@ static void *ft_get_phandle(struct ft_cx
 {
 	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




More information about the Linuxppc-dev mailing list