Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 863ad786 authored by Rajkumar Subbiah's avatar Rajkumar Subbiah
Browse files

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: default avatarRajkumar Subbiah <rsubbia@codeaurora.org>
parent e3c33c9d
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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,