chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e10f3c4
)
bootchart: oom-check correct variable
author
Andreas Henriksson
<andreas@fatal.se>
Tue, 16 Sep 2014 17:40:25 +0000
(19:40 +0200)
committer
Tom Gundersen
<teg@jklm.no>
Tue, 16 Sep 2014 18:25:30 +0000
(20:25 +0200)
Coverity warned that we have already dereferenced ps->sample before
null-checking it. I suspect that's not really the issue and that
the check is checking the wrong variable.
Likely the oom-check should be on the just allocated ps->sample->next.
Found by coverity. Fixes: CID#
1237765
src/bootchart/store.c
patch
|
blob
|
history
diff --git
a/src/bootchart/store.c
b/src/bootchart/store.c
index ed46a503c672171e397b933e7f47f6a1f6d76bd7..ed683e88d97472fb11c42ea5c55c2dd1cf1ca656 100644
(file)
--- a/
src/bootchart/store.c
+++ b/
src/bootchart/store.c
@@
-399,7
+399,7
@@
schedstat_next:
continue;
ps->sample->next = new0(struct ps_sched_struct, 1);
- if (!ps->sample) {
+ if (!ps->sample
->next
) {
log_oom();
exit(EXIT_FAILURE);
}