From: Michael Walle Date: Mon, 21 Oct 2019 22:37:02 +0200 Subject: [U-Boot] [PATCH] armv8: fsl-layerscape: fix hwconfig and prefetching Message-ID: <20191021203702.26739-1-michael@walle.cc> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de If CONFIG_HWCONFIG is disabled, hwconfig_subarg_f() will return the empty string, ie. not NULL. Therefore, we have to check the returned argument length as well as the return value. Signed-off-by: Michael Walle --- arch/arm/cpu/armv8/fsl-layerscape/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c index a5d0b5370f..4bb73b524c 100644 --- a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c +++ b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c @@ -1073,7 +1073,7 @@ static void config_core_prefetch(void) prefetch_arg = hwconfig_subarg_f("core_prefetch", "disable", &arglen, buf); - if (prefetch_arg) { + if (arglen && prefetch_arg) { mask = simple_strtoul(prefetch_arg, NULL, 0) & 0xff; if (mask & 0x1) { printf("Core0 prefetch can't be disabled\n"); -- 2.20.1