diff options
author | jcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-12-06 18:10:34 +0000 |
---|---|---|
committer | jcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-12-06 18:10:34 +0000 |
commit | c154b9970849127546f50481b586d61d78c9bbec (patch) | |
tree | b48f8b103b2791ec8c0021f96e4cd36b7a2dc221 /ShellPkg/Library | |
parent | eca37a3101811a879521b7bdff18524fd86cf8fa (diff) | |
download | edk2-platforms-c154b9970849127546f50481b586d61d78c9bbec.tar.xz |
fixes for NULL verification.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11125 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg/Library')
-rw-r--r-- | ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c | 63 |
1 files changed, 33 insertions, 30 deletions
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c index ccfa0b0654..d74a47ba52 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c @@ -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);
}
|