Skip to contentSkip to conversation

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

PATCH In review Zhen Lei 2 participants 2 messages May 8, 2021 – May 15, 2021

Subsystems (3)
lore
Share & tools
lore

Zhen Lei

author
#0 lore raw

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

Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function.

Fixes 7f9743abaa79 ("drm/msm: validate display and event threads")
---
 drivers/gpu/drm/msm/msm_drv.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/msm/msm_drv.c +1 -0
index e1104d2454e2..ebd856dde1f1 100644
@@ -523,6 +523,7 @@ static int msm_drm_init(struct device *dev, const struct drm_driver *drv)
 		priv->event_thread[i].worker = kthread_create_worker(0,
 			"crtc_event:%d", priv->event_thread[i].crtc_id);
 		if (IS_ERR(priv->event_thread[i].worker)) {
+			ret = PTR_ERR(priv->event_thread[i].worker);
 			DRM_DEV_ERROR(dev, "failed to create crtc_event kthread\n");
 			goto err_msm_uninit;
 		}
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Zhen Lei

Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function.

Fixes 7f9743abaa79 ("drm/msm: validate display and event threads")
Quoted 17 lines
---
  drivers/gpu/drm/msm/msm_drv.c | 1 +
  1 file changed, 1 insertion(+)
drivers/gpu/drm/msm/msm_drv.c +1 -0
index e1104d2454e2..ebd856dde1f1 100644
@@ -523,6 +523,7 @@ static int msm_drm_init(struct device *dev, const struct drm_driver *drv)
  		priv->event_thread[i].worker = kthread_create_worker(0,
  			"crtc_event:%d", priv->event_thread[i].crtc_id);
  		if (IS_ERR(priv->event_thread[i].worker)) {
+			ret = PTR_ERR(priv->event_thread[i].worker);
  			DRM_DEV_ERROR(dev, "failed to create crtc_event kthread\n");
  			goto err_msm_uninit;
  		}
Signature · 2 lines
With best wishes
Dmitry