Code Review
/
vpp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
review
|
tree
raw
|
patch
| inline |
side by side
(parent:
fc283bc
)
perfmon: fix coverity warning
28/34528/2
author
Klement Sekera
<
[email protected]
>
Tue, 16 Nov 2021 11:32:59 +0000
(12:32 +0100)
committer
Ole Tr�an
<
[email protected]
>
Tue, 16 Nov 2021 16:19:40 +0000
(16:19 +0000)
Check for possible hash lookup failure to avoid NULL dereference.
Type: fix
Fixes:
e15c999c30
Signed-off-by: Klement Sekera <
[email protected]
>
Change-Id: Ib806b4d124be26fbccf36fe9d19af1aec63f487b
src/plugins/perfmon/intel/bundle/iio_bw.c
patch
|
blob
|
history
diff --git
a/src/plugins/perfmon/intel/bundle/iio_bw.c
b/src/plugins/perfmon/intel/bundle/iio_bw.c
index
9aaca42
..
66c550f
100644
(file)
--- a/
src/plugins/perfmon/intel/bundle/iio_bw.c
+++ b/
src/plugins/perfmon/intel/bundle/iio_bw.c
@@
-126,9
+126,16
@@
format_stack_socket (u8 *s, va_list *va)
}
uword *pu = hash_get (h, root_bus.bus);
- e = pool_elt_at_index (p, (index_t) pu[0]);
+ if (pu)
+ {
+ e = pool_elt_at_index (p, (index_t) pu[0]);
- s = format (s, "IIO%u/%u", e->socket_id, e->iio_unit_id);
+ s = format (s, "IIO%u/%u", e->socket_id, e->iio_unit_id);
+ }
+ else
+ {
+ s = format (s, "[ERR: hash lookup for bus '%u' failed]", root_bus.bus);
+ }
return s;
}