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

Commit

Permalink
Merge pull request #129 from sched-ext/fix-null-scx_exit_info
Browse files Browse the repository at this point in the history
scx: fix NULL pointer dereference with scx_exit_info
  • Loading branch information
Byte-Lab authored Jan 28, 2024
2 parents 58ac752 + fa75b1f commit 65c2651
Showing 1 changed file with 3 additions and 2 deletions.
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

0 comments on commit 65c2651

Please sign in to comment.