sched: fix locking in a653sched_free_vdata()

The arinc653 scheduler's free_vdata() function is missing proper
locking: as it is modifying the scheduler's private vcpu list it needs
to take the scheduler lock during that operation.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Dario Faggioli <dfaggioli@suse.com>
This commit is contained in:
Juergen Gross authored and Jan Beulich committed 2019-09-27 14:03:42 +02:00
1 parent ddc5a85fbc
commit 19049f8d79
1 file changed
+6
+6
View File
@@ -442,16 +442,22 @@ a653sched_alloc_vdata(const struct scheduler *ops, struct vcpu *vc, void *dd)
static void
a653sched_free_vdata(const struct scheduler *ops, void *priv)
{
a653sched_priv_t *sched_priv = SCHED_PRIV(ops);
arinc653_vcpu_t *av = priv;
unsigned long flags;
if (av == NULL)
return;
spin_lock_irqsave(&sched_priv->lock, flags);
if ( !is_idle_vcpu(av->vc) )
list_del(&av->list);
xfree(av);
update_schedule_vcpus(ops);
spin_unlock_irqrestore(&sched_priv->lock, flags);
}
/**
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.