/*++\r
\r
-Copyright (c) 2006, Intel Corporation \r
-All rights reserved. This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+Copyright (c) 2006 - 2007, Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
Module Name:\r
\r
ConPlatform.c\r
- \r
+\r
Abstract:\r
\r
--*/\r
/*++\r
\r
Routine Description:\r
- Supported \r
+ Supported\r
\r
Arguments:\r
(Standard DriverBinding Protocol Supported() function)\r
/*++\r
\r
Routine Description:\r
- Supported \r
+ Supported\r
\r
Arguments:\r
(Standard DriverBinding Protocol Supported() function)\r
/*++\r
\r
Routine Description:\r
- Supported \r
+ Supported\r
\r
Arguments:\r
(Standard DriverBinding Protocol Supported() function)\r
Caller is repsoncible freeing the buffer.\r
\r
NULL - Variable was not read\r
- \r
+\r
--*/\r
{\r
EFI_STATUS Status;\r
//\r
// Allocate the buffer to return\r
//\r
- Status = gBS->AllocatePool (EfiBootServicesData, BufferSize, &Buffer);\r
- if (EFI_ERROR (Status)) {\r
+ Buffer = AllocatePool (BufferSize);\r
+ if (Buffer == NULL) {\r
return NULL;\r
}\r
//\r
Buffer\r
);\r
if (EFI_ERROR (Status)) {\r
- gBS->FreePool (Buffer);\r
+ FreePool (Buffer);\r
Buffer = NULL;\r
}\r
}\r
Multi - A pointer to a multi-instance device path data structure.\r
\r
Single - A pointer to a single-instance device path data structure.\r
- \r
+\r
NewDevicePath - If Delete is TRUE, this parameter must not be null, and it\r
- points to the remaining device path data structure. \r
+ points to the remaining device path data structure.\r
(remaining device path = Multi - Single.)\r
- \r
+\r
Delete - If TRUE, means removing Single from Multi.\r
- If FALSE, the routine just check whether Single matches \r
+ If FALSE, the routine just check whether Single matches\r
with any instance in Multi.\r
\r
Returns:\r
\r
- The function returns EFI_SUCCESS if the Single is contained within Multi. \r
+ The function returns EFI_SUCCESS if the Single is contained within Multi.\r
Otherwise, EFI_NOT_FOUND is returned.\r
\r
--*/\r
while (DevicePathInst) {\r
if (CompareMem (Single, DevicePathInst, Size) == 0) {\r
if (!Delete) {\r
- gBS->FreePool (DevicePathInst);\r
+ FreePool (DevicePathInst);\r
return EFI_SUCCESS;\r
}\r
} else {\r
TempDevicePath1,\r
DevicePathInst\r
);\r
- gBS->FreePool (TempDevicePath1);\r
+ if (TempDevicePath1 != NULL) {\r
+ FreePool (TempDevicePath1);\r
+ }\r
TempDevicePath1 = TempDevicePath2;\r
}\r
}\r
\r
- gBS->FreePool (DevicePathInst);\r
+ FreePool (DevicePathInst);\r
DevicePathInst = GetNextDevicePathInstance (&DevicePath, &Size);\r
}\r
\r
/*++\r
\r
Routine Description:\r
- \r
+\r
\r
Arguments:\r
\r
//\r
// The device path is already in the variable\r
//\r
- gBS->FreePool (VariableDevicePath);\r
+ if (VariableDevicePath != NULL) {\r
+ FreePool (VariableDevicePath);\r
+ }\r
\r
return Status;\r
}\r
);\r
}\r
\r
- gBS->FreePool (VariableDevicePath);\r
+ if (VariableDevicePath != NULL) {\r
+ FreePool (VariableDevicePath);\r
+ }\r
\r
if (EFI_ERROR (Status)) {\r
return Status;\r
NewVariableDevicePath\r
);\r
\r
- gBS->FreePool (NewVariableDevicePath);\r
+ FreePool (NewVariableDevicePath);\r
\r
return Status;\r
}\r