[Intel-gfx] [PATCH i-g-t] lib/igt_kms: Fix passing invalid fd to openat(2).
Marius Vlad
marius.c.vlad at intel.com
Fri Jun 3 15:06:19 UTC 2016
Introduced by 0e11befe442. openat(2) uses a relative path. Fix by
passing the correct fd.
Signed-off-by: Marius Vlad <marius.c.vlad at intel.com>
CC: Chris Wilson <chris at chris-wilson.co.uk>
---
lib/igt_kms.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index b12a5b3..135c7b8 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -641,7 +641,8 @@ bool kmstest_force_connector(int drm_fd, drmModeConnector *connector,
return false;
}
- if (!igt_sysfs_set(drm_fd, path, value)) {
+ /* use the fd returned by igt_sysfs_open() */
+ if (!igt_sysfs_set(dir, path, value)) {
close(dir);
return false;
}
--
2.5.0
More information about the Intel-gfx
mailing list