Skip to content

Commit ce86c23

Browse files
fltorobclark
authored andcommitted
drm/msm/a6xx: avoid shadow NULL reference in failure path
If a6xx_hw_init() fails before creating the shadow_bo, the a6xx_pm_suspend code referencing it will crash. Change the condition to one that avoids this problem (note: creation of shadow_bo is behind this same condition) Fixes: e8b0b99 ("drm/msm/a6xx: Clear shadow on suspend") Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Akhil P Oommen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Rob Clark <[email protected]>
1 parent b4387ea commit ce86c23

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1284,7 +1284,7 @@ static int a6xx_pm_suspend(struct msm_gpu *gpu)
12841284
if (ret)
12851285
return ret;
12861286

1287-
if (adreno_gpu->base.hw_apriv || a6xx_gpu->has_whereami)
1287+
if (a6xx_gpu->shadow_bo)
12881288
for (i = 0; i < gpu->nr_rings; i++)
12891289
a6xx_gpu->shadow[i] = 0;
12901290

0 commit comments

Comments
 (0)