xfree86: Do not claim pci slots if fb slot is already claimed

Submitted by Michal Srb on Jan. 2, 2019, 12:59 p.m.

Details

Message ID 20190102125936.16639-1-msrb@suse.com
State New
Series "xfree86: Do not claim pci slots if fb slot is already claimed"
Headers show

Commit Message

Michal Srb Jan. 2, 2019, 12:59 p.m.
The xf86PostProbe would terminate with fatal error if both fb and pci
slots were claimed at the same time, so there is no point in trying.
The opposite logic already exists in xf86ClaimFbSlot - fb slots will
not be claimed if any pci slot was claimed.

This fixes issue when (autoconfigured) fbdev and vesa drivers both claim
a device (e.g. /dev/fb0 provided by the vesafb kernel driver).

Signed-off-by: Michal Srb <msrb@suse.com>
---
 hw/xfree86/common/xf86pciBus.c | 3 +++
 1 file changed, 3 insertions(+)

Patch hide | download patch | download mbox

diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c
index 0718cdcb0..24396a63c 100644
--- a/hw/xfree86/common/xf86pciBus.c
+++ b/hw/xfree86/common/xf86pciBus.c
@@ -212,6 +212,9 @@  xf86ClaimPciSlot(struct pci_device *d, DriverPtr drvp,
     EntityPtr p = NULL;
     int num;
 
+    if (fbSlotClaimed)
+        return -1;
+
     if (xf86CheckPciSlot(d)) {
         num = xf86AllocateEntity();
         p = xf86Entities[num];