drm/v3d: Fix return if scheduler initialization fails
If the scheduler initialization fails, GEM initialization must fail as well. Therefore, if `v3d_sched_init()` fails, free the DMA memory allocated and return the error value in `v3d_gem_init()`. Signed-off-by: Maíra Canal <mcanal@igalia.com> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240923141348.2422499-4-mcanal@igalia.com
This commit is contained in:
@@ -291,8 +291,9 @@ v3d_gem_init(struct drm_device *dev)
|
||||
ret = v3d_sched_init(v3d);
|
||||
if (ret) {
|
||||
drm_mm_takedown(&v3d->mm);
|
||||
dma_free_coherent(v3d->drm.dev, 4096 * 1024, (void *)v3d->pt,
|
||||
dma_free_coherent(v3d->drm.dev, pt_size, (void *)v3d->pt,
|
||||
v3d->pt_paddr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user