phys->hw_pp = dpu_enc->hw_pp[i];
                phys->hw_ctl = to_dpu_hw_ctl(hw_ctl[i]);
 
-               if (phys->intf_idx >= INTF_0 && phys->intf_idx < INTF_MAX)
-                       phys->hw_intf = dpu_rm_get_intf(&dpu_kms->rm, phys->intf_idx);
-
-               if (phys->wb_idx >= WB_0 && phys->wb_idx < WB_MAX)
-                       phys->hw_wb = dpu_rm_get_wb(&dpu_kms->rm, phys->wb_idx);
-
-               if (!phys->hw_intf && !phys->hw_wb) {
-                       DPU_ERROR_ENC(dpu_enc,
-                                     "no intf or wb block assigned at idx: %d\n", i);
-                       return;
-               }
-
-               if (phys->hw_intf && phys->hw_wb) {
-                       DPU_ERROR_ENC(dpu_enc,
-                                       "invalid phys both intf and wb block at idx: %d\n", i);
-                       return;
-               }
-
                phys->cached_mode = crtc_state->adjusted_mode;
                if (phys->ops.atomic_mode_set)
                        phys->ops.atomic_mode_set(phys, crtc_state, conn_state);
                struct dpu_encoder_phys *phys = dpu_enc->phys_encs[i];
                atomic_set(&phys->vsync_cnt, 0);
                atomic_set(&phys->underrun_cnt, 0);
+
+               if (phys->intf_idx >= INTF_0 && phys->intf_idx < INTF_MAX)
+                       phys->hw_intf = dpu_rm_get_intf(&dpu_kms->rm, phys->intf_idx);
+
+               if (phys->wb_idx >= WB_0 && phys->wb_idx < WB_MAX)
+                       phys->hw_wb = dpu_rm_get_wb(&dpu_kms->rm, phys->wb_idx);
+
+               if (!phys->hw_intf && !phys->hw_wb) {
+                       DPU_ERROR_ENC(dpu_enc, "no intf or wb block assigned at idx: %d\n", i);
+                       ret = -EINVAL;
+               }
+
+               if (phys->hw_intf && phys->hw_wb) {
+                       DPU_ERROR_ENC(dpu_enc,
+                                       "invalid phys both intf and wb block at idx: %d\n", i);
+                       ret = -EINVAL;
+               }
        }
+
        mutex_unlock(&dpu_enc->enc_lock);
 
        return ret;