[PATCH v3] drm/i915/gt: Protect against overflow in active_engine()
Sebastian Brzezinka
sebastian.brzezinka at intel.com
Tue Aug 5 11:55:21 UTC 2025
Hi Krzysztof
On Tue Aug 5, 2025 at 11:41 AM UTC, 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: Sebastian Brzezinka <sebastian.brzezinka at intel.com>
--
Best regards,
Sebastian
More information about the Intel-gfx
mailing list