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 | |
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')
-rw-r--r-- | overlay/config.c | 1 | ||||
-rw-r--r-- | overlay/gem-objects.c | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/overlay/config.c b/overlay/config.c index 56e0147a..b6bd8dc3 100644 --- a/overlay/config.c +++ b/overlay/config.c @@ -196,6 +196,7 @@ static int add_value(const char *section, return 0; memcpy(s->name, section, len); + s->values = NULL; s->next = c->sections; c->sections = s; } 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; |