diff options
author | Dave Airlie <airlied@panoply-rh.(none)> | 2008-03-13 16:16:46 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-06-19 13:28:21 +1000 |
commit | aef6b904ebf0d7de6259058606c7c04ea177bda3 (patch) | |
tree | eef0e812a5620abe3855599503a4f901799b148a | |
parent | 3efb23a6c40dc3583d083d25ada3853ecc56000d (diff) |
fbdev: make entity fail if PCI claimed already.
bad kitty fbdev, been shipping this in Fedora for a while now
-rw-r--r-- | hw/xfree86/common/xf86Bus.c | 3 | ||||
-rw-r--r-- | hw/xfree86/common/xf86fbBus.c | 7 |
2 files changed, 10 insertions, 0 deletions
diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c index 8382d911a..0d732d0b1 100644 --- a/hw/xfree86/common/xf86Bus.c +++ b/hw/xfree86/common/xf86Bus.c @@ -428,6 +428,9 @@ xf86GetEntityInfo(int entityIndex) EntityInfoPtr pEnt; int i; + if (entityIndex == -1) + return NULL; + if (entityIndex >= xf86NumEntities) return NULL; diff --git a/hw/xfree86/common/xf86fbBus.c b/hw/xfree86/common/xf86fbBus.c index a18963991..90e6eb0b6 100644 --- a/hw/xfree86/common/xf86fbBus.c +++ b/hw/xfree86/common/xf86fbBus.c @@ -57,6 +57,13 @@ xf86ClaimFbSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active) { EntityPtr p; int num; + + if (pciSlotClaimed) + return -1; +#if defined(__sparc__) || defined (__sparc64__) + if (sbusSlotClaimed) + return -1; +#endif num = xf86AllocateEntity(); p = xf86Entities[num]; |