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::d42; helo=mail-io1-xd42.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-io1-xd42.google.com (mail-io1-xd42.google.com [IPv6:2607:f8b0:4864:20::d42]) (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 C86642117FD44 for ; Thu, 8 Nov 2018 22:56:09 -0800 (PST) Received: by mail-io1-xd42.google.com with SMTP id p83-v6so558399iod.12 for ; Thu, 08 Nov 2018 22:56:09 -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=IWMdEQoH4/0ho0MZ/jShehlMWfkNUrje+cPe1NrWn6M=; b=T3ASxbI0QRT3p7dAADpzALfF4YNbpf/l2S2Wf+KYsKL4x9HkzhoaKdvX9CSSA8eA4p KnsV7F0v7VXGloVIDBK3TPToML9d6N5yTxXcgD3vVLroAhlcJez4PfI44bSTGmkAtPgo 3c4rEjC6qifZaEvnUDoJ4OjDHNdZ1CAxywuNk= 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=IWMdEQoH4/0ho0MZ/jShehlMWfkNUrje+cPe1NrWn6M=; b=ghEfgXa8BB0KIbzAaANRzsXpH1/kqFnwjXfP2eH20nx3En6vOohSM+tALSsVeIEbPb GY8lD0Mm1ZzBty8lZ5L/Jy5IjXkKoQRDKnZYN0WnR6WSTnhYfw+KkNAedsj/rgPlxvs0 R84mqGw1Nt3VSFptt8i+Mf7WKckYSfVVnc/XAVV9WauAre4Kjgwab+EhbRN4o34Bpo/P uRp4wjpkxtW7CPKrk6UKnA5+A84h0mURCk05NV0gAx4pkg0n+UXXvZix4+sicsxEoa8Q /nmImSxd4bm1nlCPUWsJm43fKiw6ilqSp5UtsNxPDTB5YF5gSC6M98ucNZn3HJWuiOKJ Z/2g== X-Gm-Message-State: AGRZ1gJXwtEa7Bojkh+hcNZZiIjwn6W6uwnWHou2DVO18sEYklbx8SMo dfMRMgWiitZn7Z/JwxKdakIhpjJ7OZ6CrbvdYMPNZg== X-Google-Smtp-Source: AJdET5d2MBRbHt4/memoE/KU8hfVUaY66qDmPJvgrvINH82eWxFEFMtQC3Gzqw9MqsJ5MLbrL/Br4ANLtnqJXnGEbxI= X-Received: by 2002:a6b:5d18:: with SMTP id r24-v6mr5944520iob.170.1541746568595; Thu, 08 Nov 2018 22:56:08 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a6b:4f16:0:0:0:0:0 with HTTP; Thu, 8 Nov 2018 22:56:07 -0800 (PST) In-Reply-To: <4A89E2EF3DFEDB4C8BFDE51014F606A14E367B56@SHSMSX104.ccr.corp.intel.com> References: <20181107145311.42488-1-dandan.bi@intel.com> <0C09AFA07DD0434D9E2A0C6AEB048310401EC2D7@shsmsx102.ccr.corp.intel.com> <4A89E2EF3DFEDB4C8BFDE51014F606A14E367B56@SHSMSX104.ccr.corp.intel.com> From: Ard Biesheuvel Date: Fri, 9 Nov 2018 07:56:07 +0100 Message-ID: To: "Gao, Liming" Cc: "Zeng, Star" , "Bi, Dandan" , "edk2-devel@lists.01.org" , "Wu, Hao A" , "Dong, Eric" 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: Fri, 09 Nov 2018 06:56:10 -0000 Content-Type: text/plain; charset="UTF-8" On 9 November 2018 at 01:19, Gao, Liming wrote: > Ard: > This is a small fix. And, this patch is sent before the hard freeze. It is the low risk for this release. So, I push it. > OK, fair enough. >>-----Original Message----- >>From: Ard Biesheuvel [mailto:ard.biesheuvel@linaro.org] >>Sent: Friday, November 09, 2018 2:25 AM >>To: Zeng, Star >>Cc: Bi, Dandan ; edk2-devel@lists.01.org; Wu, Hao A >>; Dong, Eric ; Gao, Liming >> >>Subject: Re: [edk2] [patch] MdeModulePkg/DisplayEngine: Remove useless >>NULL ptr check for NewPos >> >>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