瀏覽代碼

[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 <scottwood@freescale.com>
Acked-by: Mark A. Greer <mgreer@mvista.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Scott Wood 18 年之前
父節點
當前提交
c8aa72633e
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      arch/powerpc/boot/flatdevtree.c

+ 3 - 0
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;