[3.16.y-ckt stable] Patch "of/fdt: fix error checking for earlycon address" has been added to staging queue

Luis Henriques luis.henriques at canonical.com
Mon Nov 30 12:35:14 UTC 2015


This is a note to let you know that I have just added a patch titled

    of/fdt: fix error checking for earlycon address

to the linux-3.16.y-queue branch of the 3.16.y-ckt extended stable tree 
which can be found at:

    http://kernel.ubuntu.com/git/ubuntu/linux.git/log/?h=linux-3.16.y-queue

This patch is scheduled to be released in version 3.16.7-ckt21.

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.16.y-ckt tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Luis

------

>From fbbc8e7892cdf1ff1cfe8ff637576ffc85206a09 Mon Sep 17 00:00:00 2001
From: Masahiro Yamada <yamada.masahiro at socionext.com>
Date: Fri, 23 Oct 2015 20:47:20 +0900
Subject: of/fdt: fix error checking for earlycon address

commit 3f5ceec96470050d20d7281d49985e3b1cfc3995 upstream.

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 at socionext.com>
Signed-off-by: Rob Herring <robh at kernel.org>
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
 drivers/of/fdt.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index 5c437ca532b3..24ad55129194 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -774,14 +774,15 @@ 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);




More information about the kernel-team mailing list