!connector_helper_funcs->best_encoder)
return -ENXIO;
encoder = connector_helper_funcs->best_encoder(connector);
+ if (!encoder)
+ return -ENXIO;
encoder_helper_funcs = encoder->helper_private;
- if (!encoder || !encoder_helper_funcs->atomic_check)
+ if (!encoder_helper_funcs->atomic_check)
return -ENXIO;
ret = encoder_helper_funcs->atomic_check(encoder, crtc->state,
conn_state);
int pipe = drm_crtc_index(crtc);
struct rockchip_drm_private *priv = crtc->dev->dev_private;
- if (pipe > ROCKCHIP_MAX_CRTC)
+ if (pipe >= ROCKCHIP_MAX_CRTC)
return -EINVAL;
priv->crtc_funcs[pipe] = crtc_funcs;
int pipe = drm_crtc_index(crtc);
struct rockchip_drm_private *priv = crtc->dev->dev_private;
- if (pipe > ROCKCHIP_MAX_CRTC)
+ if (pipe >= ROCKCHIP_MAX_CRTC)
return;
priv->crtc_funcs[pipe] = NULL;