26f86dd
From 78a9e96e0fa041ac7581aa5fbef8862996855cb7 Mon Sep 17 00:00:00 2001
26f86dd
From: Adam Jackson <ajax@redhat.com>
26f86dd
Date: Wed, 8 Dec 2010 13:45:32 -0500
26f86dd
Subject: [PATCH] Refuse to load if there's a kernel driver bound to the device
26f86dd
26f86dd
Ported from the equivalent check in nv.
26f86dd
26f86dd
Signed-off-by: Adam Jackson <ajax@redhat.com>
26f86dd
---
26f86dd
 src/vesa.c |    8 +++++++-
26f86dd
 1 files changed, 7 insertions(+), 1 deletions(-)
26f86dd
26f86dd
diff --git a/src/vesa.c b/src/vesa.c
26f86dd
index 168fde1..204297e 100644
26f86dd
--- a/src/vesa.c
26f86dd
+++ b/src/vesa.c
26f86dd
@@ -431,8 +431,14 @@ VESAPciProbe(DriverPtr drv, int entity_num, struct pci_device *dev,
26f86dd
     pScrn = xf86ConfigPciEntity(NULL, 0, entity_num, NULL, 
26f86dd
 				NULL, NULL, NULL, NULL, NULL);
26f86dd
     if (pScrn != NULL) {
26f86dd
-	VESAPtr pVesa = VESAGetRec(pScrn);
26f86dd
+	VESAPtr pVesa;
26f86dd
 
26f86dd
+	if (pci_device_has_kernel_driver(dev)) {
26f86dd
+	    ErrorF("Refusing to touch device with a bound kernel driver\n");
26f86dd
+	    return FALSE;
26f86dd
+	}
26f86dd
+
26f86dd
+	pVesa = VESAGetRec(pScrn);
26f86dd
 	VESAInitScrn(pScrn);
26f86dd
 	pVesa->pciInfo = dev;
26f86dd
     }
26f86dd
-- 
26f86dd
1.7.3.2
26f86dd