arinc653: move next_switch_time access under lock

Even before its recent movement to the scheduler's private data
structure it looks to have been wrong to update the field under lock,
but then read it with the lock no longer held.

Coverity-ID: 1644500
Fixes: 9f0c658bae ("arinc: add cpu-pool support to scheduler")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Nathan Studer <nathan.studer@dornerworks.com>
This commit is contained in:
Jan Beulich committed 2025-03-25 09:23:48 +01:00
1 parent b7234d32e3
commit 28fa31d6bb
1 file changed
+4 -5
+4 -5
View File
@@ -580,6 +580,9 @@ a653sched_do_schedule(
*/
BUG_ON(now >= sched_priv->next_major_frame);
/* Return the amount of time the next domain has to run. */
prev->next_time = sched_priv->next_switch_time - now;
spin_unlock_irqrestore(&sched_priv->lock, flags);
/* Tasklet work (which runs in idle UNIT context) overrides all else. */
@@ -591,11 +594,7 @@ a653sched_do_schedule(
&& (sched_unit_master(new_task) != cpu) )
new_task = IDLETASK(cpu);
/*
* Return the amount of time the next domain has to run and the address
* of the selected task's UNIT structure.
*/
prev->next_time = sched_priv->next_switch_time - now;
/* Also return the address of the selected task's UNIT structure. */
prev->next_task = new_task;
new_task->migrated = false;
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.