diff options
| author | Rajkumar Subbiah <rsubbia@codeaurora.org> | 2017-05-05 14:11:10 -0400 |
|---|---|---|
| committer | Rajkumar Subbiah <rsubbia@codeaurora.org> | 2017-05-05 14:17:06 -0400 |
| commit | 863ad786eb08087d6dafbc02bfd1a93fa9446af5 (patch) | |
| tree | 3f1d1914e7ad0b84694ef62f097f8fc64b566653 | |
| parent | e3c33c9d53650719b2302ca34738978d9df49c49 (diff) | |
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>
| -rw-r--r-- | drivers/media/platform/msm/sde/rotator/sde_rotator_r3.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/media/platform/msm/sde/rotator/sde_rotator_r3.c b/drivers/media/platform/msm/sde/rotator/sde_rotator_r3.c index 34ec6529d8ae..8157e8641e60 100644 --- a/drivers/media/platform/msm/sde/rotator/sde_rotator_r3.c +++ b/drivers/media/platform/msm/sde/rotator/sde_rotator_r3.c @@ -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, |
