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];