diff options
author | Isaku Yamahata <yamahata@valinux.co.jp> | 2010-09-09 11:48:56 +0900 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2010-09-13 21:03:51 +0200 |
commit | 2bbb9c2f7f36d0457cda5f27d7e4422219b3acd8 (patch) | |
tree | ff7c7a1a9a26e84629283df6ab7ae3c89d594dd9 /hw/pci.c | |
parent | 5a9ff3819a1023b63b94ad4fb82da973f93f65d0 (diff) | |
download | qemu-2bbb9c2f7f36d0457cda5f27d7e4422219b3acd8.zip qemu-2bbb9c2f7f36d0457cda5f27d7e4422219b3acd8.tar.gz qemu-2bbb9c2f7f36d0457cda5f27d7e4422219b3acd8.tar.bz2 |
pci: don't ignore invalid parameter for pci_register_bar().
Abort when invalid value for region_num is passed to pci_register_bar.
That is caller's bug. Abort instead of silently ignoring invalid value.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/pci.c')
-rw-r--r-- | hw/pci.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -765,9 +765,8 @@ void pci_register_bar(PCIDevice *pci_dev, int region_num, uint32_t addr; uint64_t wmask; - if ((unsigned int)region_num >= PCI_NUM_REGIONS) - return; - + assert(region_num >= 0); + assert(region_num < PCI_NUM_REGIONS); if (size & (size-1)) { fprintf(stderr, "ERROR: PCI region size must be pow2 " "type=0x%x, size=0x%"FMT_PCIBUS"\n", type, size); |