drm/msm: Check for NULL before calling prepare_commit()
authorJessica Zhang <quic_jesszhan@quicinc.com>
Tue, 21 Feb 2023 18:42:54 +0000 (10:42 -0800)
committerDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Thu, 6 Apr 2023 17:29:24 +0000 (20:29 +0300)
Add a NULL check before calling prepare_commit() in
msm_atomic_commit_tail()

Signed-off-by: Jessica Zhang <quic_jesszhan@quicinc.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org>
Patchwork: https://patchwork.freedesktop.org/patch/523604/
Link: https://lore.kernel.org/r/20230221184256.1436-3-quic_jesszhan@quicinc.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
drivers/gpu/drm/msm/msm_atomic.c

index c5e71c05f038bcf9db949d4e77da059eaa37eaf5..608a969efea21186a2f2592be04707ed7bbdc7c4 100644 (file)
@@ -205,7 +205,8 @@ void msm_atomic_commit_tail(struct drm_atomic_state *state)
         * Now that there is no in-progress flush, prepare the
         * current update:
         */
-       kms->funcs->prepare_commit(kms, state);
+       if (kms->funcs->prepare_commit)
+               kms->funcs->prepare_commit(kms, state);
 
        /*
         * Push atomic updates down to hardware: