[PATCH v3] drm/i915/gt: Protect against overflow in active_engine()
Andi Shyti
andi.shyti at linux.intel.com
Tue Aug 5 11:46:39 UTC 2025
Hi Krzysztof,
On Tue, Aug 05, 2025 at 11:41:42AM +0000, Krzysztof Karas wrote:
> It is unlikely, but possible for the first call to
> intel_context_create() to fail with -ENOMEM, which would result
> in entering the following code block and decrementing "count",
> when it is set to 0 (initial condition in the for loop).
>
> Protect from overflowing the variable by checking for 0 value
> of "count" before entering the loop.
>
> Signed-off-by: Krzysztof Karas <krzysztof.karas at intel.com>
Reviewed-by: Andi Shyti <andi.shyti at linux.intel.com>
Thanks,
Andi
More information about the Intel-gfx
mailing list