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>
This commit is contained in:
Chris Wilson 2014-12-21 13:50:34 +00:00
parent 7f9d14aa51
commit 0be9766952
2 changed files with 6 additions and 1 deletions

View File

@ -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;
}

View File

@ -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;