From patchwork Mon Oct 21 20:37:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Walle X-Patchwork-Id: 1180859 X-Patchwork-Delegate: priyanka.jain@nxp.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=walle.cc Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=walle.cc header.i=@walle.cc header.b="S3vfupma"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46xpNL2LqZz9sP4 for ; Tue, 22 Oct 2019 07:37:22 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id F3F09C21E49; Mon, 21 Oct 2019 20:37:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id B7AE1C21C50; Mon, 21 Oct 2019 20:37:10 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id F2009C21C50; Mon, 21 Oct 2019 20:37:08 +0000 (UTC) Received: from ssl.serverraum.org (ssl.serverraum.org [176.9.125.105]) by lists.denx.de (Postfix) with ESMTPS id 900F1C21C2C for ; Mon, 21 Oct 2019 20:37:08 +0000 (UTC) Received: from apollo.fritz.box (unknown [IPv6:2a02:810c:c200:2e91:6257:18ff:fec4:ca34]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id 134F422433; Mon, 21 Oct 2019 22:37:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1571690228; bh=YEh60r0So/Y2Bm+fnyXYSD/7iptIyn1hOAACpLhOBJw=; h=From:To:Cc:Subject:Date:From; b=S3vfupmaHOISaoKux8WWByKM0y4K4P1LFSNQeJC86MkwlWxHKDoI1jzn+C30uLRp7 jWyQgXZQ2os3+kVxmwV7L9qW8Vlex4j6bVhKlIt/PL6qfRrxSy7r1AQYToxKb60qhw tuYP+hL7awiAhMMqCTOsq8/ausMQesUl+Wmi8xI8= From: Michael Walle To: u-boot@lists.denx.de Date: Mon, 21 Oct 2019 22:37:02 +0200 Message-Id: <20191021203702.26739-1-michael@walle.cc> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.101.4 at web X-Virus-Status: Clean Cc: Tom Rini Subject: [U-Boot] [PATCH] armv8: fsl-layerscape: fix hwconfig and prefetching X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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");