diff mbox series

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

Message ID 20201117023649.26657-1-liwei391@huawei.com (mailing list archive)
State New, archived
Headers show
Series drm/msm: Fix error return code in msm_drm_init() | expand

Commit Message

liwei (GF) Nov. 17, 2020, 2:36 a.m. UTC
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")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Li <liwei391@huawei.com>
---
 drivers/gpu/drm/msm/msm_drv.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Abhinav Kumar Nov. 17, 2020, 7:52 p.m. UTC | #1
On 2020-11-16 18:36, Wei Li wrote:
> 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")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Li <liwei391@huawei.com>
Reviewed-by: Abhinav Kumar <abhinavk@codeaurora.org>
> ---
>  drivers/gpu/drm/msm/msm_drv.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/msm/msm_drv.c 
> b/drivers/gpu/drm/msm/msm_drv.c
> index 49685571dc0e..37a373c5ced3 100644
> --- a/drivers/gpu/drm/msm/msm_drv.c
> +++ b/drivers/gpu/drm/msm/msm_drv.c
> @@ -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;
>  		}
diff mbox series

Patch

diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index 49685571dc0e..37a373c5ced3 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -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;
 		}