credit2: avoid NULL deref in csched2_res_pick() when tracing
authorJan Beulich <jbeulich@suse.com>
Tue, 3 Mar 2020 15:01:30 +0000 (16:01 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 3 Mar 2020 15:01:30 +0000 (16:01 +0100)
commit8824fd3871a2ded6bee0f48785bf539aff46a771
tree391c751f2f31f17959b6f37ff2375fecdf30ce06
parent005de45c887e0fefde59570686877afeda2c7b4e
credit2: avoid NULL deref in csched2_res_pick() when tracing

The issue here results from one of the downsides of using goto: The
early "goto out" and "goto out_up" in the function very clearly bypass
any possible initialization of min_rqd, yet the tracing code at the end
of the function consumes the value. There's even a comment regarding the
trace record not being accurate in this case.

CID: 1460432
Fixes: 9c84bc004653 ("sched: rework credit2 run-queue allocation")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Acked-by: Dario Faggioli <dfaggioli@suse.com>
xen/common/sched/credit2.c