]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Add parameter checking for PCI IO protocol according to UEFI spec.
authorxli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524>
Sat, 21 Jun 2008 11:16:36 +0000 (11:16 +0000)
committerxli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524>
Sat, 21 Jun 2008 11:16:36 +0000 (11:16 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5359 6f19259b-4bc3-4df7-8a09-765794883524

IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciIo.c

index ccec7d7244d585c04094d0b1920dea735ccad42b..eabbe4989b3f7f36e1549b3033d069f08eba7b6a 100644 (file)
@@ -1,7 +1,7 @@
 /**@file\r
   Implement all interfaces for EFI_PCI_IO_PROTOCOL.\r
   \r
-Copyright (c) 2006, Intel Corporation                                                         \r
+Copyright (c) 2006 - 2008, 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
@@ -379,6 +379,10 @@ PciIoMemRead (
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
+  if (Buffer == NULL) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
+\r
   Status = PciIoVerifyBarAccess (PciIoDevice, BarIndex, PciBarTypeMem, Width, Count, &Offset);\r
   if (EFI_ERROR (Status)) {\r
     return EFI_UNSUPPORTED;\r
@@ -439,6 +443,10 @@ PciIoMemWrite (
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
+  if (Buffer == NULL) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
+\r
   Status = PciIoVerifyBarAccess (PciIoDevice, BarIndex, PciBarTypeMem, Width, Count, &Offset);\r
   if (EFI_ERROR (Status)) {\r
     return EFI_UNSUPPORTED;\r
@@ -499,6 +507,10 @@ PciIoIoRead (
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
+  if (Buffer == NULL) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
+\r
   Status = PciIoVerifyBarAccess (PciIoDevice, BarIndex, PciBarTypeIo, Width, Count, &Offset);\r
   if (EFI_ERROR (Status)) {\r
     return EFI_UNSUPPORTED;\r
@@ -559,6 +571,10 @@ PciIoIoWrite (
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
+  if (Buffer == NULL) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
+\r
   Status = PciIoVerifyBarAccess (PciIoDevice, BarIndex, PciBarTypeIo, Width, Count, &Offset);\r
   if (EFI_ERROR (Status)) {\r
     return EFI_UNSUPPORTED;\r