[Intel-gfx] [PATCH 4/4] Klock work Fix for uninitialized array intel_migrate.c

Ramalingam C ramalingam.c at intel.com
Tue Jun 29 08:52:51 UTC 2021


On 2021-06-28 at 20:08:29 +0530, Bommu Krishnaiah wrote:
> Signed-off-by: Bommu Krishnaiah <krishnaiah.bommu at intel.com>
> Cc: Chris Wilson <chris at chris-wilson.co.uk>
> ---
>  drivers/gpu/drm/i915/gt/intel_migrate.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/gt/intel_migrate.c b/drivers/gpu/drm/i915/gt/intel_migrate.c
> index 23c59ce66cee5..5df7b8af6fdb9 100644
> --- a/drivers/gpu/drm/i915/gt/intel_migrate.c
> +++ b/drivers/gpu/drm/i915/gt/intel_migrate.c
> @@ -208,11 +208,15 @@ static struct intel_context *__migrate_engines(struct intel_gt *gt)
>  
>  	count = 0;
>  	for (i = 0; i < ARRAY_SIZE(gt->engine_class[COPY_ENGINE_CLASS]); i++) {
> +
>  		engine = gt->engine_class[COPY_ENGINE_CLASS][i];
>  		if (engine_supports_migration(engine))
>  			engines[count++] = engine;
>  	}
>  
> +	if (count == 0)
> +		return ERR_PTR(-ENXIO);
> +
>  	return intel_context_create(engines[random_index(count)]);
This Kclockwork warning/error is false positive.

As intel_migrate_copy->intel_migrate_create_context->__migrate_engines is called
after the checkfor valid m->context which is created for first copy engine.

So atleast one blitter is assured. hence we can ignore this Kclockwork
result.

Ram.
>  }
>  
> -- 
> 2.25.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx


More information about the Intel-gfx mailing list