Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754939AbbLIJls (ORCPT ); Wed, 9 Dec 2015 04:41:48 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:45521 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754915AbbLIJlo (ORCPT ); Wed, 9 Dec 2015 04:41:44 -0500 From: Luis Henriques To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, kernel-team@lists.ubuntu.com Cc: Masahiro Yamada , Rob Herring , Luis Henriques Subject: [PATCH 3.16.y-ckt 107/126] of/fdt: fix error checking for earlycon address Date: Wed, 9 Dec 2015 09:37:57 +0000 Message-Id: <1449653896-5236-108-git-send-email-luis.henriques@canonical.com> In-Reply-To: <1449653896-5236-1-git-send-email-luis.henriques@canonical.com> References: <1449653896-5236-1-git-send-email-luis.henriques@canonical.com> X-Extended-Stable: 3.16 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1480 Lines: 46 3.16.7-ckt21 -stable review patch. If anyone has any objections, please let me know. ------------------ From: Masahiro Yamada 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 Signed-off-by: Rob Herring Signed-off-by: Luis Henriques --- 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); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/