msm: sde: Fix potential deferencing of null pointer

While configuring the hw rotator, if the output format is not
found, the fmt will be NULL and we could be deferencing it.
Adding a NULL check to prevent it.

Change-Id: I64bafa79f0be28fc9f6573f055dba46a7bcdfbcc
Signed-off-by: Rajkumar Subbiah <rsubbia@codeaurora.org>
This commit is contained in:
Rajkumar Subbiah 2017-05-05 14:11:10 -04:00
parent e3c33c9d53
commit 863ad786eb

View file

@ -1771,6 +1771,10 @@ static int sde_hw_rotator_config(struct sde_rot_hw_resource *hw,
wb_cfg.fps = entry->perf->config.frame_rate;
wb_cfg.bw = entry->perf->bw;
wb_cfg.fmt = sde_get_format_params(item->output.format);
if (!wb_cfg.fmt) {
SDEROT_ERR("Output format is NULL\n");
return -EINVAL;
}
wb_cfg.dst_rect = &item->dst_rect;
wb_cfg.data = &entry->dst_buf;
sde_mdp_get_plane_sizes(wb_cfg.fmt, item->output.width,