From: Scott Wood Date: Mon, 12 Mar 2007 20:41:45 +0000 (-0600) Subject: [POWERPC] bootwrapper: Make ft_get_phandle() accept and return NULL. X-Git-Tag: v2.6.22-rc1~1109^2~183 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=c8aa72633e65c5c215b0cdd9970642e2a4f9a9a3;p=linux-2.6-omap-h63xx.git [POWERPC] bootwrapper: Make ft_get_phandle() accept and return NULL. 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 Acked-by: Mark A. Greer Signed-off-by: Paul Mackerras --- diff --git a/arch/powerpc/boot/flatdevtree.c b/arch/powerpc/boot/flatdevtree.c index 971420af08d..6c1877358ae 100644 --- a/arch/powerpc/boot/flatdevtree.c +++ b/arch/powerpc/boot/flatdevtree.c @@ -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;