drm/msm/dpu: remove IS_ERR_OR_NULL for dpu_hw_intr_init() error handling
authorDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Fri, 1 Dec 2023 21:18:34 +0000 (00:18 +0300)
committerDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Tue, 5 Dec 2023 19:14:33 +0000 (22:14 +0300)
Using IS_ERR_OR_NULL() together with PTR_ERR() is a typical mistake. If
the value is NULL, then the function will return 0 instead of a proper
return code. Replace IS_ERR_OR_NULL() with IS_ERR() in the
dpu_hw_intr_init() error check.

Reviewed-by: Jessica Zhang <quic_jesszhan@quicinc.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/570036/
Link: https://lore.kernel.org/r/20231201211845.1026967-3-dmitry.baryshkov@linaro.org
drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c

index cc6e2c05e79407346dace54da7b92d44d9b6665d..75663f1626188d3eb96d597b7920a6d50d2fa0ec 100644 (file)
@@ -1135,7 +1135,7 @@ static int dpu_kms_hw_init(struct msm_kms *kms)
        }
 
        dpu_kms->hw_intr = dpu_hw_intr_init(dpu_kms->mmio, dpu_kms->catalog);
-       if (IS_ERR_OR_NULL(dpu_kms->hw_intr)) {
+       if (IS_ERR(dpu_kms->hw_intr)) {
                rc = PTR_ERR(dpu_kms->hw_intr);
                DPU_ERROR("hw_intr init failed: %d\n", rc);
                dpu_kms->hw_intr = NULL;