[Intel-xe] [PATCH] fixup! drm/xe: Introduce a new DRM driver for Intel GPUs

Matt Roper matthew.d.roper at intel.com
Wed May 31 14:46:46 UTC 2023


On Tue, May 30, 2023 at 11:19:02PM -0700, Lucas De Marchi wrote:
> drm/xe/sr: Fix too many kfree() on reallocation
> 
> When re-allocating the array, the previous location shouldn't be freed.
> The issue can be more easily reproduced by reducing
> XE_REG_SR_GROW_STEP_DEFAULT. This was crashing kunit during cleanup
> on semi-random places depending on the number of save-restore entries.
> 
> Jointly debugged with Matt Roper.
> 
> Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>

Reviewed-by: Matt Roper <matthew.d.roper at intel.com>

> ---
>  drivers/gpu/drm/xe/xe_reg_sr.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_reg_sr.c b/drivers/gpu/drm/xe/xe_reg_sr.c
> index 24d9c73ef279..434133444d74 100644
> --- a/drivers/gpu/drm/xe/xe_reg_sr.c
> +++ b/drivers/gpu/drm/xe/xe_reg_sr.c
> @@ -57,7 +57,6 @@ static struct xe_reg_sr_entry *alloc_entry(struct xe_reg_sr *sr)
>  		if (!arr)
>  			return NULL;
>  
> -		kfree(sr->pool.arr);
>  		sr->pool.arr = arr;
>  		sr->pool.allocated += sr->pool.grow_step;
>  	}
> -- 
> 2.40.1
> 

-- 
Matt Roper
Graphics Software Engineer
VTT-OSGC Platform Enablement
Intel Corporation
(916) 356-2795


More information about the Intel-xe mailing list