diff options
author | Johan Hovold <[email protected]> | 2023-03-06 11:07:16 +0100 |
---|---|---|
committer | Dmitry Baryshkov <[email protected]> | 2023-04-06 20:29:39 +0300 |
commit | cd459c005de3e2b855a8cc7768e633ce9d018e9f (patch) | |
tree | cacc94b6abdaab45786fb44886b0256c72d75251 | |
parent | a465353b9250802f87b97123e33a17f51277f0b1 (diff) |
drm/msm: fix NULL-deref on irq uninstall
In case of early initialisation errors and on platforms that do not use
the DPU controller, the deinitilisation code can be called with the kms
pointer set to NULL.
Fixes: f026e431cf86 ("drm/msm: Convert to Linux IRQ interfaces")
Cc: [email protected] # 5.14
Cc: Thomas Zimmermann <[email protected]>
Signed-off-by: Johan Hovold <[email protected]>
Reviewed-by: Dmitry Baryshkov <[email protected]>
Patchwork: https://patchwork.freedesktop.org/patch/525104/
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Dmitry Baryshkov <[email protected]>
-rw-r--r-- | drivers/gpu/drm/msm/msm_drv.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index 91d60608a19a..ffc25e3db031 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -252,9 +252,11 @@ static int msm_drm_uninit(struct device *dev) drm_bridge_remove(priv->bridges[i]); priv->num_bridges = 0; - pm_runtime_get_sync(dev); - msm_irq_uninstall(ddev); - pm_runtime_put_sync(dev); + if (kms) { + pm_runtime_get_sync(dev); + msm_irq_uninstall(ddev); + pm_runtime_put_sync(dev); + } if (kms && kms->funcs) kms->funcs->destroy(kms); |