Skip to content

Commit

Permalink
drm/i915/selftests: Change priority overflow detection
Browse files Browse the repository at this point in the history
Check for integer overflow in the priority chain, rather than against a
type-constricted max-priority check.

Signed-off-by: Chris Wilson <[email protected]>
Reviewed-by: Mika Kuoppala <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
  • Loading branch information
ickle committed May 19, 2020
1 parent b86fc6e commit ad65868
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/gpu/drm/i915/gt/selftest_lrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2735,12 +2735,12 @@ static int live_preempt_gang(void *arg)
/* Submit each spinner at increasing priority */
engine->schedule(rq, &attr);

if (prio < attr.priority)
break;

if (prio <= I915_PRIORITY_MAX)
continue;

if (prio > (INT_MAX >> I915_USER_PRIORITY_SHIFT))
break;

if (__igt_timeout(end_time, NULL))
break;
} while (1);
Expand Down

0 comments on commit ad65868

Please sign in to comment.