diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2019-12-03 16:47:24 +0200 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2019-12-04 19:00:57 +0200 |
commit | 9bb52ff1bc170897dbc8948282e076017ea3dfd2 (patch) | |
tree | cd32864d503cd4add59f7c9582b1647f71e302c4 /lib/igt_kms.c | |
parent | e1503da2d461b2a8d92808d6945a3cd30e48d21b (diff) |
lib/igt_kms: Don't leak fds when forcing connector multiple times
Close the new sysfs directory fd when we've already forced
the same connector previously. Currently we're leaking the fd.
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Diffstat (limited to 'lib/igt_kms.c')
-rw-r--r-- | lib/igt_kms.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/igt_kms.c b/lib/igt_kms.c index 830cee78..00373a6c 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -1075,6 +1075,8 @@ bool kmstest_force_connector(int drm_fd, drmModeConnector *connector, if (len != -1 && len < MAX_CONNECTORS) { forced_connectors[len] = path; forced_connectors_device[len] = dir; + } else { + close(dir); } if (len >= MAX_CONNECTORS) |