mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-26 17:26:14 +00:00
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:
parent
7f9d14aa51
commit
0be9766952
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user