From patchwork Mon Dec 3 10:23:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 1006783 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) 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=public-files.de Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 437h1B2sC5z9sBh for ; Mon, 3 Dec 2018 21:23:53 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 381F3C2219A; Mon, 3 Dec 2018 10:23:46 +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=RCVD_IN_DNSWL_BLOCKED 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 0E6B9C22055; Mon, 3 Dec 2018 10:23:44 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 3A3F0C22055; Mon, 3 Dec 2018 10:23:42 +0000 (UTC) Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) by lists.denx.de (Postfix) with ESMTPS id D765EC22005 for ; Mon, 3 Dec 2018 10:23:41 +0000 (UTC) Received: from [91.14.81.146] ([91.14.81.146]) by web-mail.gmx.net (3c-app-gmx-bs20.server.lan [172.19.170.72]) (via HTTP); Mon, 3 Dec 2018 11:23:41 +0100 MIME-Version: 1.0 Message-ID: From: "Frank Wunderlich" To: u-boot@lists.denx.de Date: Mon, 3 Dec 2018 11:23:41 +0100 Importance: normal Sensitivity: Normal X-Priority: 3 X-Provags-ID: V03:K1:yigS/5NFeNs0mF3QYaO/rHJu0Q5IIyoLetZ66rsB8mXDjvpfWHCar8sU0+iF62PKRLn6C F9QprkYGgyk5yBgpiDHPfMTueVdOTkf9NOLHEJZBL+TUSNif2tvvBVsbfCrs9uNCqhmqgQ0oM6mS /HAimO2dP4hEeeQJ08vyDaeWdX2/jP+KmOXoUF9qKbofMbUdZerjwdjiKBmKAEMrzx21ZVayb9NK gTTP83AfON/nM0nWJjnZaU1URFeQq3FsIDLrhGe1hSbjTTZeMKgJjHBCYFE6KmfhCvoqYELGcp7e 6k= X-UI-Out-Filterresults: notjunk:1; V03:K0:tSrd0DilzgE=:MvsS2u+EtC1GxCdGSwnprf 0bw39HRw2d+2O9IVpYvYp/WbCHLM6/G98o/nXB19KhZQZOjF+Z8jKjAYCM92A6Hobl6xJ4L2L ik3KIzKW2uv+T+g/w/GPNUWVzUb7GfWvCVsFyN3CCd7PIdylWc3suaIU0dBAGdfATWfjjEs+k qktg/9Fiwh0XQlwaHunIeNC0pAptjBo6bJvHLIBqHPanSCpWaWKkBbyiMOeyHMagLZajG9u46 m308WcHNxRmp1n0uC7A193irhtGRIxy75pf+T+28Ez26VGmZAR+ZzET6bA5H4Ay3ytPv8+cl+ eo4VtJNkMXtKooTpjBSsD7reEENQcbJuERpf519VJECZTFHK7bdUCc2qiti5SdelvEoER/9dV 1YAHO4uOPqJ2piw9d60AdcWqvokxijCi7SypS0i+9hfdTzR+g3X045Nny/KwwDFKV9DlSnIUO nX6oBfx4jLrEdkoKnKK+39EKFWQDUqURxqiMN1NuqhpF+KiM23vcKic1Xj7m8WN1zkRra5DnQ S13dgKmnMIVFgTCIEtM7ct+vQQMhMaomGbLoSCztS2bPxa11jUYQ5sNKgLj7vvE4I67nE1kb7 YF0osOqG5VVOg= Subject: [U-Boot] ensure active menuitem is inside menu 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" Hi, setting active menuitem currently can be outside of menu which results in invisible selection attached Patch fixes this regards Frank From 1d9c4cb8b3e2dd9b0a7a6a2d4a21684d0a099dbf Mon Sep 17 00:00:00 2001 From: Frank Wunderlich Date: Sun, 2 Dec 2018 11:23:53 +0100 Subject: [PATCH] ensure active menuitem is inside menu if active menuitem is defined via environment var it can be outside the menu (>=menuitem-count) this patch resets this definition back to 0 Signed-off-by: Frank Wunderlich --- cmd/bootmenu.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/bootmenu.c b/cmd/bootmenu.c index 979ac4a638..7f88c1ed63 100644 --- a/cmd/bootmenu.c +++ b/cmd/bootmenu.c @@ -351,6 +351,12 @@ static struct bootmenu_data *bootmenu_create(int delay) } menu->count = i; + + if ((menu->active >= menu->count)||(menu->active < 0)) { //ensure active menuitem is inside menu + printf("active menuitem (%d) is outside menu (0..%d)\n",menu->active,menu->count-1); + menu->active=0; + } + return menu; cleanup: -- 2.17.1