diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2018-10-24 15:59:35 +0100 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2018-10-24 15:59:35 +0100 |
commit | 8076029c5ca81dee348126cd7fe199b248b7809b (patch) | |
tree | 13c0f76a8100980c37397d29d4725cecc6d3ab83 /hw/xfree86/fbdevhw/fbdevhw.c | |
parent | 7d416f031b61d6d6be376ba45018b135505980a7 (diff) | |
parent | 2a0c6c15c35cd262e7cdb86dcc43cb1aeb714c8e (diff) |
Merge tag 'xorg-server-1.20.2' into cygwin-release-1.20xserver-cygwin-1.20.2-1
xorg-server-1.20.2
Diffstat (limited to 'hw/xfree86/fbdevhw/fbdevhw.c')
-rw-r--r-- | hw/xfree86/fbdevhw/fbdevhw.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/hw/xfree86/fbdevhw/fbdevhw.c b/hw/xfree86/fbdevhw/fbdevhw.c index 0bd77df87..3fb1d2bba 100644 --- a/hw/xfree86/fbdevhw/fbdevhw.c +++ b/hw/xfree86/fbdevhw/fbdevhw.c @@ -329,6 +329,22 @@ fbdev_open(int scrnIndex, const char *dev, char **namep) return -1; } + /* only touch non-PCI devices on this path */ + { + char buf[PATH_MAX]; + char *sysfs_path = NULL; + char *node = strrchr(dev, '/') + 1; + + if (asprintf(&sysfs_path, "/sys/class/graphics/%s", node) < 0 || + readlink(sysfs_path, buf, sizeof(buf) < 0) || + strstr(buf, "devices/pci")) { + free(sysfs_path); + close(fd); + return -1; + } + free(sysfs_path); + } + if (namep) { if (-1 == ioctl(fd, FBIOGET_FSCREENINFO, (void *) (&fix))) { *namep = NULL; |