forked from Mirrors/opensbi
lib: sbi: sse_event_get() may return NULL
sse_event_get() may return NULL. We should not dereference the return value
in sbi_sse_exit() without checking.
Fixes: c8cdf01d8f
("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>
This commit is contained in:

committed by
Anup Patel

parent
68bc031a76
commit
37e1544a86
@@ -1119,7 +1119,7 @@ void sbi_sse_exit(struct sbi_scratch *scratch)
|
|||||||
for (i = 0; i < EVENT_COUNT; i++) {
|
for (i = 0; i < EVENT_COUNT; i++) {
|
||||||
e = sse_event_get(supported_events[i]);
|
e = sse_event_get(supported_events[i]);
|
||||||
|
|
||||||
if (e->attrs.hartid != current_hartid())
|
if (!e || e->attrs.hartid != current_hartid())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (sse_event_state(e) > SBI_SSE_STATE_REGISTERED) {
|
if (sse_event_state(e) > SBI_SSE_STATE_REGISTERED) {
|
||||||
|
Reference in New Issue
Block a user