fixes for NULL verification.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11125 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jcarsey
2010-12-06 18:10:34 +00:00
parent eca37a3101
commit c154b99708
3 changed files with 109 additions and 105 deletions

View File

@ -679,18 +679,19 @@ PerformMappingDelete(
return (Status);
}
//
// Get the map name(s) for each one.
//
for ( LoopVar = 0
; LoopVar < BufferSize / sizeof(EFI_HANDLE)
; LoopVar ++
){
if (PerformSingleMappingDelete(Specific,HandleBuffer[LoopVar]) == SHELL_SUCCESS) {
Deleted = TRUE;
if (HandleBuffer != NULL) {
//
// Get the map name(s) for each one.
//
for ( LoopVar = 0
; LoopVar < BufferSize / sizeof(EFI_HANDLE)
; LoopVar ++
){
if (PerformSingleMappingDelete(Specific,HandleBuffer[LoopVar]) == SHELL_SUCCESS) {
Deleted = TRUE;
}
}
}
//
// Look up all BlockIo in the platform
//
@ -718,30 +719,32 @@ PerformMappingDelete(
return (Status);
}
//
// Get the map name(s) for each one.
//
for ( LoopVar = 0
; LoopVar < BufferSize / sizeof(EFI_HANDLE)
; LoopVar ++
){
if (HandleBuffer != NULL) {
//
// Skip any that were already done...
// Get the map name(s) for each one.
//
if (gBS->OpenProtocol(
HandleBuffer[LoopVar],
&gEfiDevicePathProtocolGuid,
NULL,
gImageHandle,
NULL,
EFI_OPEN_PROTOCOL_TEST_PROTOCOL) == EFI_SUCCESS) {
continue;
}
if (PerformSingleMappingDelete(Specific,HandleBuffer[LoopVar]) == SHELL_SUCCESS) {
Deleted = TRUE;
for ( LoopVar = 0
; LoopVar < BufferSize / sizeof(EFI_HANDLE)
; LoopVar ++
){
//
// Skip any that were already done...
//
if (gBS->OpenProtocol(
HandleBuffer[LoopVar],
&gEfiDevicePathProtocolGuid,
NULL,
gImageHandle,
NULL,
EFI_OPEN_PROTOCOL_TEST_PROTOCOL) == EFI_SUCCESS) {
continue;
}
if (PerformSingleMappingDelete(Specific,HandleBuffer[LoopVar]) == SHELL_SUCCESS) {
Deleted = TRUE;
}
}
}
FreePool(HandleBuffer);
SHELL_FREE_NON_NULL(HandleBuffer);
if (!Deleted) {
return (EFI_NOT_FOUND);
}