disp: msm: fix kw issues in sde driver

This change addresses out of range and null checks in
sde driver.

Change-Id: I905d795edf6715aa990dd7bbaf061734e95ddea6
Signed-off-by: Narendra Muppalla <NarendraM@codeaurora.org>
This commit is contained in:
Narendra Muppalla
2020-03-30 15:21:06 -07:00
parent f97e75d7ab
commit d6141f8472
4 changed files with 5 additions and 4 deletions

View File

@@ -1009,7 +1009,7 @@ static void msm_lastclose(struct drm_device *dev)
rc = drm_fb_helper_restore_fbdev_mode_unlocked(priv->fbdev); rc = drm_fb_helper_restore_fbdev_mode_unlocked(priv->fbdev);
if (rc) if (rc)
DRM_ERROR("restore FBDEV mode failed: %d\n", rc); DRM_ERROR("restore FBDEV mode failed: %d\n", rc);
} else if (kms->client.dev) { } else if (kms && kms->client.dev) {
rc = drm_client_modeset_commit_force(&kms->client); rc = drm_client_modeset_commit_force(&kms->client);
if (rc) if (rc)
DRM_ERROR("client modeset commit failed: %d\n", rc); DRM_ERROR("client modeset commit failed: %d\n", rc);

View File

@@ -1364,7 +1364,7 @@ static int sde_cp_crtc_checkfeature(struct sde_cp_node *prop_node,
bool feature_enabled = false; bool feature_enabled = false;
feature_wrapper check_feature = NULL; feature_wrapper check_feature = NULL;
if (!prop_node || !sde_crtc || !sde_crtc_state) { if (!prop_node) {
DRM_ERROR("invalid arguments"); DRM_ERROR("invalid arguments");
return -EINVAL; return -EINVAL;
} }

View File

@@ -1246,7 +1246,7 @@ static void _sde_plane_setup_scaler(struct sde_plane *psde,
{ {
struct sde_hw_pixel_ext *pe; struct sde_hw_pixel_ext *pe;
uint32_t chroma_subsmpl_h, chroma_subsmpl_v; uint32_t chroma_subsmpl_h, chroma_subsmpl_v;
const struct drm_format_info *info = drm_format_info(fmt->base.pixel_format); const struct drm_format_info *info = NULL;
if (!psde || !fmt || !pstate) { if (!psde || !fmt || !pstate) {
SDE_ERROR("invalid arg(s), plane %d fmt %d state %d\n", SDE_ERROR("invalid arg(s), plane %d fmt %d state %d\n",
@@ -1254,6 +1254,7 @@ static void _sde_plane_setup_scaler(struct sde_plane *psde,
return; return;
} }
info = drm_format_info(fmt->base.pixel_format);
pe = &pstate->pixel_ext; pe = &pstate->pixel_ext;
psde->pipe_cfg.horz_decimation = psde->pipe_cfg.horz_decimation =

View File

@@ -1808,7 +1808,7 @@ static int _sde_rm_get_hw_blk_for_cont_splash(struct sde_rm *rm,
} }
while (_sde_rm_get_hw_locked(rm, &iter_dsc)) { while (_sde_rm_get_hw_locked(rm, &iter_dsc)) {
if (!ctl->ops.read_active_status && if (ctl->ops.read_active_status &&
!(ctl->ops.read_active_status(ctl, !(ctl->ops.read_active_status(ctl,
SDE_HW_BLK_DSC, SDE_HW_BLK_DSC,
iter_dsc.blk->id))) iter_dsc.blk->id)))