From 9ac0640d9cf1590f4209ead0b0fbe159fdebc307 Mon Sep 17 00:00:00 2001 From: lgao4 Date: Thu, 9 Dec 2010 12:20:36 +0000 Subject: [PATCH] EFI_INVALID_PARAMETER should return when the input Block is NULL for ConfigRouting.ConfigToBlock(). git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11145 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c index 4f83fe3866..7ab6a6e5f0 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c @@ -3406,13 +3406,16 @@ HiiConfigToBlock ( if (MaxBlockSize > BufferSize) { *BlockSize = MaxBlockSize; - if (Block == NULL) { - return EFI_INVALID_PARAMETER; - } else { + if (Block != NULL) { return EFI_DEVICE_ERROR; } } + if (Block == NULL) { + *Progress = ConfigResp; + return EFI_INVALID_PARAMETER; + } + return EFI_SUCCESS; Exit: