- Snp->PciIo->Io.Write (\r
- Snp->PciIo,\r
- Width,\r
- Snp->IoBarIndex, // BAR 1 (for 32bit regs), IO base address\r
- MemOrPortAddr,\r
- 1, // count\r
- (VOID *) (UINTN) BufferPtr\r
- );\r
+ ASSERT (Snp->IoBarIndex < PCI_MAX_BAR);\r
+ if (Snp->IoBarIndex < PCI_MAX_BAR) {\r
+ Snp->PciIo->Io.Write (\r
+ Snp->PciIo,\r
+ Width,\r
+ Snp->IoBarIndex, // BAR 1 (for 32bit regs), IO base address\r
+ MemOrPortAddr,\r
+ 1, // count\r
+ (VOID *) (UINTN) BufferPtr\r
+ );\r
+ }\r