This is a note to let you know that I've just added the patch titled drm/msm/a6xx: avoid shadow NULL reference in failure path to the 5.12-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: drm-msm-a6xx-avoid-shadow-null-reference-in-failure-path.patch and it can be found in the queue-5.12 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From ce86c239e4d218ae6040bec18e6d19a58edb8b7c Mon Sep 17 00:00:00 2001 From: Jonathan Marek <jonathan@xxxxxxxx> Date: Thu, 13 May 2021 13:14:00 -0400 Subject: drm/msm/a6xx: avoid shadow NULL reference in failure path From: Jonathan Marek <jonathan@xxxxxxxx> commit ce86c239e4d218ae6040bec18e6d19a58edb8b7c upstream. 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: e8b0b994c3a5 ("drm/msm/a6xx: Clear shadow on suspend") Signed-off-by: Jonathan Marek <jonathan@xxxxxxxx> Reviewed-by: Akhil P Oommen <akhilpo@xxxxxxxxxxxxxx> Link: https://lore.kernel.org/r/20210513171431.18632-6-jonathan@xxxxxxxx Signed-off-by: Rob Clark <robdclark@xxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c @@ -1284,7 +1284,7 @@ static int a6xx_pm_suspend(struct msm_gp if (ret) return ret; - if (adreno_gpu->base.hw_apriv || a6xx_gpu->has_whereami) + if (a6xx_gpu->shadow_bo) for (i = 0; i < gpu->nr_rings; i++) a6xx_gpu->shadow[i] = 0; Patches currently in stable-queue which might be from jonathan@xxxxxxxx are queue-5.12/drm-msm-a6xx-avoid-shadow-null-reference-in-failure-path.patch queue-5.12/drm-msm-a6xx-fix-incorrectly-set-uavflagprd_inv-field-for-a650.patch queue-5.12/drm-msm-a6xx-update-fix-cp_protect-initialization.patch