pseries: Fix array overrun bug in PCI code
authorDavid Gibson <david@gibson.dropbear.id.au>
Mon, 28 Nov 2011 20:21:39 +0000 (20:21 +0000)
committerAlexander Graf <agraf@suse.de>
Thu, 12 Jan 2012 17:30:50 +0000 (18:30 +0100)
commit365110e970d72db4ab7970572dbbfcb9081acdb6
treed04d15ee0e846cae2bb317d3276287ddd35e4dc5
parent43d032be8fa811aa6eed9bb125e88ffd06478435
pseries: Fix array overrun bug in PCI code

spapr_populate_pci_devices() containd a loop with PCI_NUM_REGIONS (7)
iterations.  However this overruns the 'bars' global array, which only has
6 elements. In fact we only want to run this loop for things listed in the
bars array, so this patch corrects the loop bounds to reflect that.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
(cherry picked from commit 135712de61dfa22368e98914d65b8b0860ec8505)
hw/spapr_pci.c