Skip to content

Commit ef3b040

Browse files
aloktiwaRob Clark
authored andcommitted
drm/msm/a6xx: move preempt_prepare_postamble after error check
Move the call to preempt_prepare_postamble() after verifying that preempt_postamble_ptr is valid. If preempt_postamble_ptr is NULL, dereferencing it in preempt_prepare_postamble() would lead to a crash. This change avoids calling the preparation function when the postamble allocation has failed, preventing potential NULL pointer dereference and ensuring proper error handling. Fixes: 50117ca ("drm/msm/a6xx: Use posamble to reset counters on preemption") Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com> Patchwork: https://patchwork.freedesktop.org/patch/687659/ Message-ID: <20251113082839.3821867-1-alok.a.tiwari@oracle.com> Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com>
1 parent 129049d commit ef3b040

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/gpu/drm/msm/adreno/a6xx_preempt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,11 +454,11 @@ void a6xx_preempt_init(struct msm_gpu *gpu)
454454
gpu->vm, &a6xx_gpu->preempt_postamble_bo,
455455
&a6xx_gpu->preempt_postamble_iova);
456456

457-
preempt_prepare_postamble(a6xx_gpu);
458-
459457
if (IS_ERR(a6xx_gpu->preempt_postamble_ptr))
460458
goto fail;
461459

460+
preempt_prepare_postamble(a6xx_gpu);
461+
462462
timer_setup(&a6xx_gpu->preempt_timer, a6xx_preempt_timer, 0);
463463

464464
return;

0 commit comments

Comments
 (0)