Update the local var e after iterating to the next engine when searching for the next non-virtual engine. Otherwise, it is prone to loop forever. Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> Cc: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxx> Cc: Andi Shyti <andi.shyti@xxxxxxxxx> Cc: Petri Latvala <petri.latvala@xxxxxxxxx> --- lib/i915/gem_engine_topology.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/i915/gem_engine_topology.c b/lib/i915/gem_engine_topology.c index 43a99e0ff..9daa03df4 100644 --- a/lib/i915/gem_engine_topology.c +++ b/lib/i915/gem_engine_topology.c @@ -180,10 +180,8 @@ intel_get_current_physical_engine(struct intel_engine_data *ed) { struct intel_execution_engine2 *e; - for (e = intel_get_current_engine(ed); - e && e->is_virtual; - intel_next_engine(ed)) - ; + while ((e = intel_get_current_engine(ed)) && e->is_virtual) + intel_next_engine(ed); return e; } -- 2.25.0 _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx