From cb1ac4a749a208eb8f9995042a110134977146d2 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 13 Mar 2008 16:16:46 +1000 Subject: [PATCH] fbdev: make entity fail if PCI claimed already. bad kitty fbdev. --- hw/xfree86/common/xf86Bus.c | 3 +++ hw/xfree86/common/xf86fbBus.c | 7 +++++++ 2 files changed, 10 insertions(+), 0 deletions(-) Index: xorg-server/hw/xfree86/common/xf86Bus.c =================================================================== --- xorg-server.orig/hw/xfree86/common/xf86Bus.c +++ xorg-server/hw/xfree86/common/xf86Bus.c @@ -429,6 +429,9 @@ EntityInfoPtr pEnt; int i; + if (entityIndex == -1) + return NULL; + if (entityIndex >= xf86NumEntities) return NULL; Index: xorg-server/hw/xfree86/common/xf86fbBus.c =================================================================== --- xorg-server.orig/hw/xfree86/common/xf86fbBus.c +++ xorg-server/hw/xfree86/common/xf86fbBus.c @@ -58,6 +58,13 @@ { EntityPtr p; int num; + + if (pciSlotClaimed) + return -1; +#if defined(__sparc__) || defined (__sparc64__) + if (sbusSlotClaimed) + return -1; +#endif num = xf86AllocateEntity(); p = xf86Entities[num];