/*++\r
-Copyright (c) 2006, Intel Corporation\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
return EFI_INVALID_PARAMETER;\r
}\r
\r
- Status = gBS->AllocatePool (\r
- EfiBootServicesData,\r
- sizeof (struct s_v2p),\r
- (VOID **) v2p\r
- );\r
-\r
- if (Status != EFI_SUCCESS) {\r
- return Status;\r
+ *v2p = AllocatePool (sizeof (struct s_v2p));\r
+ if (*v2p != NULL) {\r
+ return EFI_OUT_OF_RESOURCES;\r
}\r
\r
Status = mPciIoFncs->Map (\r
&(*v2p)->unmap\r
);\r
if (Status != EFI_SUCCESS) {\r
- gBS->FreePool (*v2p);\r
+ FreePool (*v2p);\r
return Status;\r
}\r
(*v2p)->vaddr = vaddr;\r
\r
Status = mPciIoFncs->Unmap (mPciIoFncs, v->unmap);\r
\r
- gBS->FreePool (v);\r
+ FreePool (v);\r
\r
if (Status) {\r
DEBUG ((EFI_D_ERROR, "Unmap failed with status = %x\n", Status));\r
if ((t = v->next)->vaddr == vaddr) {\r
v->next = t->next;\r
Status = mPciIoFncs->Unmap (mPciIoFncs, t->unmap);\r
- gBS->FreePool (t);\r
+ FreePool (t);\r
\r
if (Status) {\r
DEBUG ((EFI_D_ERROR, "Unmap failed with status = %x\n", Status));\r