]> git.itanic.dy.fi Git - linux-stable/commitdiff
drm/msm: remove unnecessary NULL check
authorDan Carpenter <dan.carpenter@linaro.org>
Fri, 13 Oct 2023 08:25:15 +0000 (11:25 +0300)
committerAbhinav Kumar <quic_abhinavk@quicinc.com>
Fri, 17 Nov 2023 23:32:49 +0000 (15:32 -0800)
This NULL check was required when it was added, but we shuffled the code
around and now it's not.  The inconsistent NULL checking triggers a
Smatch warning:

    drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c:847 mdp5_init() warn:
    variable dereferenced before check 'mdp5_kms' (see line 782)

Fixes: 1f50db2f3e1e ("drm/msm/mdp5: move resource allocation to the _probe function")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/562559/
Link: https://lore.kernel.org/r/ZSj+6/J6YsoSpLak@kadam
Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c

index a28fbcd0968422e6053deaeb14d72e36767a2a2b..40cda31c8ed1df9865729ce6b41a2cb22175ea48 100644 (file)
@@ -844,8 +844,7 @@ static int mdp5_init(struct platform_device *pdev, struct drm_device *dev)
 
        return 0;
 fail:
-       if (mdp5_kms)
-               mdp5_destroy(mdp5_kms);
+       mdp5_destroy(mdp5_kms);
        return ret;
 }