Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B9C93C77B7E for ; Thu, 25 May 2023 12:17:33 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 728938600A; Thu, 25 May 2023 14:17:31 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=xff.cz Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; secure) header.d=xff.cz header.i=@xff.cz header.b="iTyHJwfw"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B2E658609E; Thu, 25 May 2023 14:17:29 +0200 (CEST) Received: from vps.xff.cz (vps.xff.cz [195.181.215.36]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 7B102847E1 for ; Thu, 25 May 2023 14:17:26 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=xff.cz Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=megi@xff.cz DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xff.cz; s=mail; t=1685017045; bh=3/uNSQ90uOMNnIH2JuLD5VFu+kWV4H1+WEI6tZOH4Jw=; h=From:To:Cc:Subject:Date:From; b=iTyHJwfwUwnCiTiQtlZ0LGIr0qRWhcLRkoOLWX9jSWDlnuSlCsb/aqRgjNgaRJ5wg Q0YKObvsZk/7tIQeeGWFom1eEVmWYRe3lQnfvmV5SHU5/Fn/e9rXdsDTWz3ODND6nE xlqQY4pFOLRG6ityOogsTp2G5JVdDWGuZksfJcyI= From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= To: u-boot@lists.denx.de Cc: Ondrej Jirman , Anatolij Gustschin Subject: [PATCH] video: console: Fix default font selection Date: Thu, 25 May 2023 14:17:15 +0200 Message-Id: <20230525121715.836196-1-megi@xff.cz> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean From: Ondrej Jirman Some callers expect to call this with NULL font name to select the default font (eg. boot/scene.c). Without handling the NULL condition U-Boot crashes instead of displaying a bootflow GUI menu. Signed-off-by: Ondrej Jirman Cc: Anatolij Gustschin --- drivers/video/console_core.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/video/console_core.c b/drivers/video/console_core.c index 1f93b1b85fa5..b5d0e3dceca3 100644 --- a/drivers/video/console_core.c +++ b/drivers/video/console_core.c @@ -201,6 +201,12 @@ int console_simple_select_font(struct udevice *dev, const char *name, uint size) { struct video_fontdata *font; + if (!name) { + if (fonts->name) + console_set_font(dev, fonts); + return 0; + } + for (font = fonts; font->name; font++) { if (!strcmp(name, font->name)) { console_set_font(dev, font); -- 2.40.1