Skip to content

Commit 46d4efc

Browse files
konradybciorobclark
authored andcommitted
drm/msm/a6xx: Avoid a nullptr dereference when speedbin setting fails
Calling a6xx_destroy() before adreno_gpu_init() leads to a null pointer dereference on: msm_gpu_cleanup() : platform_set_drvdata(gpu->pdev, NULL); as gpu->pdev is only assigned in: a6xx_gpu_init() |_ adreno_gpu_init |_ msm_gpu_init() Instead of relying on handwavy null checks down the cleanup chain, explicitly de-allocate the LLC data and free a6xx_gpu instead. Fixes: 76efc24 ("drm/msm/gpu: Fix crash during system suspend after unbind") Signed-off-by: Konrad Dybcio <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/588919/ Signed-off-by: Rob Clark <[email protected]>
1 parent 3286602 commit 46d4efc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3062,7 +3062,8 @@ struct msm_gpu *a6xx_gpu_init(struct drm_device *dev)
30623062

30633063
ret = a6xx_set_supported_hw(&pdev->dev, config->info);
30643064
if (ret) {
3065-
a6xx_destroy(&(a6xx_gpu->base.base));
3065+
a6xx_llc_slices_destroy(a6xx_gpu);
3066+
kfree(a6xx_gpu);
30663067
return ERR_PTR(ret);
30673068
}
30683069

0 commit comments

Comments
 (0)