[Intel-xe] [PATCH] fixup! drm/xe: Introduce a new DRM driver for Intel GPUs
Gustavo Sousa
gustavo.sousa at intel.com
Wed May 31 13:00:25 UTC 2023
Quoting Lucas De Marchi (2023-05-31 03:19:02-03:00)
>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>
Checked and krealloc does free the old pointer if a new one is created,
so:
Reviewed-by: Gustavo Sousa <gustavo.sousa at intel.com>
By the way, I would suggest to send single-patch fixup with a cover
letter, just so Patchwork doesn't think this is a new revision of an
existing series. For example, this patch was included as a new revision
of [1].
[1] https://patchwork.freedesktop.org/series/115290/
--
Gustavo Sousa
>---
> 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
>
More information about the Intel-xe
mailing list