diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2017-03-25 00:11:26 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2017-03-25 00:20:43 +0000 |
commit | a056f7c4cd23012932ea9013967d87177219797a (patch) | |
tree | c49ed338bcc8bf580b35c97148be4cbac4e5482e | |
parent | 947f5d8037cafbff3cee0c36219a26f25c5e5204 (diff) |
lib/sysfs: stop before calling write with zero bytes
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | lib/igt_sysfs.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/igt_sysfs.c b/lib/igt_sysfs.c index dc178b3d..4fd0d47f 100644 --- a/lib/igt_sysfs.c +++ b/lib/igt_sysfs.c @@ -63,6 +63,8 @@ static int readN(int fd, char *buf, int len) return total ?: ret; total += ret; + if (total == len) + return total; } while (1); } @@ -78,6 +80,8 @@ static int writeN(int fd, const char *buf, int len) return total ?: ret; total += ret; + if (total == len) + return total; } while (1); } |