Issue
=====
If no error counter is attached to an event notifier group, calling
the `record_error()` function leads to a NULL pointer dereference.
Solution
========
Check if the error_counter field is allocated before dereferencing it.
Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I7ba68f9ae5b7b66cea538cf030bc5e1287d6eace
size_t dimension_index[1];
int ret;
+ /* This group may not have an error counter attached to it. */
+ if (!event_notifier_group->error_counter)
+ return;
+
dimension_index[0] = event_notifier->error_counter_index;
ret = event_notifier_group->error_counter->ops->counter_add(