From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4864:20::d44; helo=mail-io1-xd44.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-io1-xd44.google.com (mail-io1-xd44.google.com [IPv6:2607:f8b0:4864:20::d44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id F1A8721A07A80 for ; Thu, 8 Nov 2018 10:25:05 -0800 (PST) Received: by mail-io1-xd44.google.com with SMTP id n11-v6so15346805iob.6 for ; Thu, 08 Nov 2018 10:25:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Y3OQsEaN+gw436ZY6YBPJmaN7dNYbmKgP6BTMe1ETI0=; b=S7gYWCxREFQbeHjE69/iVAxAzfBfQW2aEjI8sZPsNwR+btpoF1d/k9k+aIaVdIYzWM 8UkxivoCYmRkNWmx0XF/tjTaWWzXOdpWGnM/HACTtaAMTtDp2PR+vDcBvXI7oFIjfbNm IwmvXzjK84N6/XEc2y+2Jw9NEqfnFS3TDa2TM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Y3OQsEaN+gw436ZY6YBPJmaN7dNYbmKgP6BTMe1ETI0=; b=eCEnqMUHigBi43Yn/Gxrmadf+k2qpTyPsoOliKE3XDNLcQ/embnuXNOkmvKC5XKe2H q1rKxU0Tm2nspXYeVuaGDRDDSCtAoOnfhAI8G5osyJUR8xajbrnCYbLZZigQUYhHNiwO l+2b1xUteSGGe/lW3hOKRWTzYEDYemTDSfmv1XEGsJMpy9s5sMNxssKe6hAzpUdYENLL 1QZw5Zju5L4gptwpR+Apg7wGsKQegqxyQBUYVPwrvXpzrGV5TWOiu8qswQIcqvnggMPO jyuYnvD4vVYzklDVRBoQjZHZPrn+tQJguLgtAGHDiSYCj3PnrS7R2Xl3JgOqrlTaM6PF XovQ== X-Gm-Message-State: AGRZ1gLR7gOER02IBMNYmFg/qGeY/aNXxbk2bw/9ctcD/g7wnjZzDaO5 p/OilXRxp1l8QEUq+gtcof/WKVKDmMSGxP1Dtap0Ag== X-Google-Smtp-Source: AJdET5dwQ1+v5zKBwYTzQOjfJHhbG+9eyWuEZTPWaO52VhyhpOk8XuMQFBkaQOG6fZSJQUfDafje9uCku33dAcnC0Ys= X-Received: by 2002:a6b:5d18:: with SMTP id r24-v6mr4431749iob.170.1541701504540; Thu, 08 Nov 2018 10:25:04 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a6b:4f16:0:0:0:0:0 with HTTP; Thu, 8 Nov 2018 10:25:03 -0800 (PST) In-Reply-To: <0C09AFA07DD0434D9E2A0C6AEB048310401EC2D7@shsmsx102.ccr.corp.intel.com> References: <20181107145311.42488-1-dandan.bi@intel.com> <0C09AFA07DD0434D9E2A0C6AEB048310401EC2D7@shsmsx102.ccr.corp.intel.com> From: Ard Biesheuvel Date: Thu, 8 Nov 2018 19:25:03 +0100 Message-ID: To: "Zeng, Star" Cc: "Bi, Dandan" , "edk2-devel@lists.01.org" , "Wu, Hao A" , "Dong, Eric" , "Gao, Liming" Subject: Re: [patch] MdeModulePkg/DisplayEngine: Remove useless NULL ptr check for NewPos X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2018 18:25:06 -0000 Content-Type: text/plain; charset="UTF-8" On 8 November 2018 at 02:09, Zeng, Star wrote: > Reviewed-by: Star Zeng > > -----Original Message----- > From: Bi, Dandan > Sent: Wednesday, November 7, 2018 10:53 PM > To: edk2-devel@lists.01.org > Cc: Gao, Liming ; Dong, Eric ; Zeng, Star ; Wu, Hao A > Subject: [patch] MdeModulePkg/DisplayEngine: Remove useless NULL ptr check for NewPos > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1306 > > In function UiDisplayMenu, the NewPos ptr which used to point to the highlight menu entry. It will always point to the menu entry which need to be highlighted or the gMenuOption menu if the highlight menu is not found. > So we can remove the NULL ptr check for NewPos in this function. > And add the ASSERT code to avoid if any false positive reports of NULL pointer dereference issue raised from static analysis. > > Cc: Liming Gao > Cc: Eric Dong > Cc: Star Zeng > Cc: Hao Wu > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Dandan Bi Why was this patch merged today? Surely, this doesn't meet the hard freeze requirements ? > --- > MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c b/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c > index 7390f954b6..44f087fe01 100644 > --- a/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c > +++ b/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c > @@ -2880,10 +2880,11 @@ UiDisplayMenu ( > // MenuOption is set to NULL in Repaint > // NewPos: Current menu option that need to hilight > // > ControlFlag = CfUpdateHelpString; > > + ASSERT (NewPos != NULL); > UpdateHighlightMenuInfo(NewPos, TopOfScreen, SkipValue); > > if (SkipHighLight) { > SkipHighLight = FALSE; > MenuOption = SavedMenuOption; > @@ -2908,11 +2909,11 @@ UiDisplayMenu ( > Temp2 = SkipValue; > } else { > Temp2 = 0; > } > > - if (NewPos != NULL && (MenuOption == NULL || NewPos != &MenuOption->Link)) { > + if (MenuOption == NULL || NewPos != &MenuOption->Link) { > if (MenuOption != NULL) { > // > // Remove the old highlight menu. > // > Status = DisplayOneMenu (MenuOption, > -- > 2.18.0.windows.1 > > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel