Blob Blame Raw
From 656ca314bb97341a07d4bbd7fcfe7af9a3689761 Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied@panoply-rh.(none)>
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 |    3 +++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
index f7ffac8..9f4e0ca 100644
--- a/hw/xfree86/common/xf86Bus.c
+++ b/hw/xfree86/common/xf86Bus.c
@@ -458,6 +458,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 102f6b1..48e101b 100644
--- a/hw/xfree86/common/xf86fbBus.c
+++ b/hw/xfree86/common/xf86fbBus.c
@@ -58,6 +58,9 @@ xf86ClaimFbSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active)
 {
     EntityPtr p;
     int num;
+
+    if (pciSlotClaimed)
+	return -1;
     
     num = xf86AllocateEntity();
     p = xf86Entities[num];
-- 
1.5.4.3