Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

scx: fix NULL pointer dereference with scx_exit_info #129

Merged
merged 1 commit into from
Jan 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions kernel/sched/ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -3614,13 +3614,13 @@ static int scx_ops_enable(struct sched_ext_ops *ops)
scx_create_rt_helper("sched_ext_ops_helper"));
if (!scx_ops_helper) {
ret = -ENOMEM;
goto err;
goto err_unlock;
}
}

if (scx_ops_enable_state() != SCX_OPS_DISABLED) {
ret = -EBUSY;
goto err;
goto err_unlock;
}

scx_exit_info = alloc_exit_info();
Expand Down Expand Up @@ -3868,6 +3868,7 @@ static int scx_ops_enable(struct sched_ext_ops *ops)
free_exit_info(scx_exit_info);
scx_exit_info = NULL;
}
err_unlock:
mutex_unlock(&scx_ops_enable_mutex);
return ret;

Expand Down