diff options
author | Tvrtko Ursulin <tvrtko.ursulin@intel.com> | 2018-09-13 16:06:13 +0100 |
---|---|---|
committer | Tvrtko Ursulin <tvrtko.ursulin@intel.com> | 2018-09-14 11:52:48 +0100 |
commit | 74dc0538de74e550f7e6d8b576051a0238f2b14e (patch) | |
tree | 0fe35396a84cb9c88da9133f58cd439bd83caaee /lib/igt_sysfs.c | |
parent | 9a8da36e708f9ed15b20689dfe305e41f9a19008 (diff) |
igt_sysfs: Avoid double closing the fd in igt_sysfs_scanf
fdopen takes ownership of the fd so only one flavour of closing it is
needed.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'lib/igt_sysfs.c')
-rw-r--r-- | lib/igt_sysfs.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/igt_sysfs.c b/lib/igt_sysfs.c index 9012cc73..d323b81d 100644 --- a/lib/igt_sysfs.c +++ b/lib/igt_sysfs.c @@ -379,8 +379,9 @@ int igt_sysfs_scanf(int dir, const char *attr, const char *fmt, ...) va_end(ap); fclose(file); + } else { + close(fd); } - close(fd); return ret; } |