[POWERPC] bootwrapper: Make ft_get_phandle() accept and return NULL.
authorScott Wood <scottwood@freescale.com>
Mon, 12 Mar 2007 20:41:45 +0000 (14:41 -0600)
committerPaul Mackerras <paulus@samba.org>
Tue, 13 Mar 2007 10:15:50 +0000 (21:15 +1100)
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@freescale.com>
Acked-by: Mark A. Greer <mgreer@mvista.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/boot/flatdevtree.c

index 971420af08d470ec345ef3b59398f3bd7646223a..6c1877358aed324a4311d4bd5f616ee1b6b5e717 100644 (file)
@@ -40,6 +40,9 @@ static void *ft_get_phandle(struct ft_cxt *cxt, char *node)
 {
        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;