提交 0fca5dea 编写于 作者: C Catalin Marinas 提交者: Rob Herring

of/fdt: NULL-terminate the root node path

Commit 509b7455 (of/fdt: Don't copy garbage after "/" in root node path)
sets the path length to 0 to ignore any garbage after "/" in the root
node path. This has the side effect of also ignoring '\0' at the end of
the root node path. This patch sets the ignores the garbage by setting
the last character to '\0' and length to 1.
Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: NRob Herring <rob.herring@calxeda.com>
上级 6872a317
......@@ -186,7 +186,8 @@ static unsigned long unflatten_dt_node(struct boot_param_header *blob,
*/
fpsize = 1;
allocl = 2;
l = 0;
l = 1;
*pathp = '\0';
} else {
/* account for '/' and path size minus terminal 0
* already in 'l'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册