sse_event_get() may return NULL. We should not dereference the return value
in sbi_sse_exit() without checking.
Fixes: c8cdf01d8f3a ("lib: sbi: Add support for Supervisor Software Events extension")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
for (i = 0; i < EVENT_COUNT; i++) {
e = sse_event_get(supported_events[i]);
- if (e->attrs.hartid != current_hartid())
+ if (!e || e->attrs.hartid != current_hartid())
continue;
if (sse_event_state(e) > SBI_SSE_STATE_REGISTERED) {