mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-27 01:36:17 +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;
|
return 0;
|
||||||
|
|
||||||
memcpy(s->name, section, len);
|
memcpy(s->name, section, len);
|
||||||
|
s->values = NULL;
|
||||||
s->next = c->sections;
|
s->next = c->sections;
|
||||||
c->sections = s;
|
c->sections = s;
|
||||||
}
|
}
|
||||||
|
@ -57,12 +57,16 @@ int gem_objects_init(struct gem_objects *obj)
|
|||||||
fd = open(buf, 0);
|
fd = open(buf, 0);
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
return errno;
|
return errno;
|
||||||
len = read(fd, buf, sizeof(buf)-1);
|
len = read(fd, buf+1, sizeof(buf)-2);
|
||||||
close(fd);
|
close(fd);
|
||||||
|
|
||||||
if (len < 0)
|
if (len < 0)
|
||||||
return EIO;
|
return EIO;
|
||||||
|
|
||||||
|
/* Add sentinel values for the string searches */
|
||||||
|
buf[0] = '\n';
|
||||||
|
buf[len+1] = '\0';
|
||||||
|
|
||||||
b = strstr(buf, "gtt total");
|
b = strstr(buf, "gtt total");
|
||||||
if (b == NULL)
|
if (b == NULL)
|
||||||
return EIO;
|
return EIO;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user