diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-12-21 13:50:34 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-12-21 13:56:04 +0000 |
commit | 0be9766952333dc54a0c568bc487660c0caf5edf (patch) | |
tree | 2dbbe52703b482be6d71ba788ce50a0a16f531a0 /overlay/gem-objects.c | |
parent | 7f9d14aa516527f6abf77b4df294acfa832d0dc6 (diff) |
overlay: A couple of valgrind pleasers
Make sure we initialise values to keep valgrind happy
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'overlay/gem-objects.c')
-rw-r--r-- | overlay/gem-objects.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/overlay/gem-objects.c b/overlay/gem-objects.c index d5044bc0..4d60299a 100644 --- a/overlay/gem-objects.c +++ b/overlay/gem-objects.c @@ -57,12 +57,16 @@ int gem_objects_init(struct gem_objects *obj) fd = open(buf, 0); if (fd < 0) return errno; - len = read(fd, buf, sizeof(buf)-1); + len = read(fd, buf+1, sizeof(buf)-2); close(fd); if (len < 0) return EIO; + /* Add sentinel values for the string searches */ + buf[0] = '\n'; + buf[len+1] = '\0'; + b = strstr(buf, "gtt total"); if (b == NULL) return EIO; |