Skip to contentSkip to conversation

drm/msm: Fix error return code in msm_drm_init()

PATCH Superseded Wei Li 2 participants 2 messages Nov 17, 2020

Subsystems (3)
lore
Share & tools
lore

Wei Li

author
#0 lore raw

PATCH 1/1 drm/msm: Fix error return code in msm_drm_init()

When it fail to create crtc_event kthread, it just jump to err_msm_uninit, while the 'ret' is not updated. So assign the return code before that.

Fixes 25fdd5933e4c ("drm/msm: Add SDM845 DPU support")
---
 drivers/gpu/drm/msm/msm_drv.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/msm/msm_drv.c +1 -0
index 49685571dc0e..37a373c5ced3 100644
@@ -506,6 +506,7 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv)
 			"crtc_event:%d", priv->event_thread[i].crtc_id);
 		if (IS_ERR(priv->event_thread[i].worker)) {
 			DRM_DEV_ERROR(dev, "failed to create crtc_event kthread\n");
+			ret = PTR_ERR(priv->event_thread[i].worker);
 			goto err_msm_uninit;
 		}
 
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Wei Li

When it fail to create crtc_event kthread, it just jump to err_msm_uninit, while the 'ret' is not updated. So assign the return code before that.

Fixes 25fdd5933e4c ("drm/msm: Add SDM845 DPU support")
Quoted 9 lines
---
 drivers/gpu/drm/msm/msm_drv.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/msm/msm_drv.c +0 -0
index 49685571dc0e..37a373c5ced3 100644

drivers/gpu/drm/msm/msm_drv.c static int msm_drm_init(struct device *dev, struct · line 512

Quoted 7 lines
drivers/gpu/drm/msm/msm_drv.c +1 -0
@@ -506,6 +506,7 @@ static int msm_drm_init(struct device *dev, struct
 drm_driver *drv)
 			"crtc_event:%d", priv->event_thread[i].crtc_id);
 		if (IS_ERR(priv->event_thread[i].worker)) {
 			DRM_DEV_ERROR(dev, "failed to create crtc_event kthread\n");
+			ret = PTR_ERR(priv->event_thread[i].worker);
 			goto err_msm_uninit;
 		}

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel