diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2015-10-23 20:47:20 +0900 |
---|---|---|
committer | Rob Herring <robh@kernel.org> | 2015-10-27 15:52:29 -0500 |
commit | 3f5ceec96470050d20d7281d49985e3b1cfc3995 (patch) | |
tree | 96120b89056d141f2a0e4ed43c730ca3030117ee /drivers/of/fdt.c | |
parent | 001cf5048e99df7ddac2716ee9958083488b6071 (diff) | |
download | lwn-3f5ceec96470050d20d7281d49985e3b1cfc3995.tar.gz lwn-3f5ceec96470050d20d7281d49985e3b1cfc3995.zip |
of/fdt: fix error checking for earlycon address
fdt_translate_address() returns OF_BAD_ADDR on error. It is defined as
a u64 value, so the variable "addr" should be defined as u64 as well.
Fixes: fb11ffe74c79 ("of/fdt: add FDT serial scanning for earlycon")
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'drivers/of/fdt.c')
-rw-r--r-- | drivers/of/fdt.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index 9fc356830226..196e449fc853 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -822,14 +822,15 @@ static int __init early_init_dt_scan_chosen_serial(void) return -ENODEV; while (match->compatible[0]) { - unsigned long addr; + u64 addr; + if (fdt_node_check_compatible(fdt, offset, match->compatible)) { match++; continue; } addr = fdt_translate_address(fdt, offset); - if (!addr) + if (addr == OF_BAD_ADDR) return -ENXIO; of_setup_earlycon(addr, match->data); |