Commit fc78bcca authored by Adam Jackson's avatar Adam Jackson Committed by Adam Jackson

fbdevhw: Refuse to touch PCI devices on the fallback probe path

Fixes: xorg/driver/xf86-video-fbdev#9Signed-off-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
parent af151895
Pipeline #5623 passed with stage
in 2 minutes and 3 seconds
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment