Skip to content

Commit 6aed508

Browse files
mairacanalpopcornmix
authored andcommitted
drm/v3d: Fix return if scheduler initialization fails
Commit 56cf76e upstream 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
1 parent b0adf60 commit 6aed508

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/gpu/drm/v3d/v3d_gem.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,9 @@ v3d_gem_init(struct drm_device *dev)
294294
ret = v3d_sched_init(v3d);
295295
if (ret) {
296296
drm_mm_takedown(&v3d->mm);
297-
dma_free_coherent(v3d->drm.dev, 4096 * 1024, (void *)v3d->pt,
297+
dma_free_coherent(v3d->drm.dev, pt_size, (void *)v3d->pt,
298298
v3d->pt_paddr);
299+
return ret;
299300
}
300301

301302
return 0;

0 commit comments

Comments
 (0)