disp: msm: sde: Register LUTDMA dummy region after parameter validation
A dummy LUTDMA region is registered prior to parameter validation, potentially causing the usage of an unallocated memory if the sde_mdss_cfg structure is invalid. Update the code flow so that the dummy LUTDMA region is registered after all parameter validation Change-Id: I9a10b166ee7a611b9d5d2cb0555822996d123c10 Signed-off-by: Christopher Braga <quic_cbraga@quicinc.com>
This commit is contained in:
@@ -122,6 +122,12 @@ int sde_reg_dma_init(void __iomem *addr, struct sde_mdss_cfg *m,
|
||||
|
||||
set_default_dma_ops(®_dma);
|
||||
|
||||
if (!addr || !m || !dev) {
|
||||
DRM_DEBUG("invalid addr %pK catalog %pK dev %pK\n", addr, m,
|
||||
dev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register dummy range to ensure register dump is only done on
|
||||
* targeted LUTDMA regions. start = 1, end = 1 so full range isn't used
|
||||
@@ -129,12 +135,6 @@ int sde_reg_dma_init(void __iomem *addr, struct sde_mdss_cfg *m,
|
||||
sde_dbg_reg_register_dump_range(LUTDMA_DBG_NAME, "DUMMY_LUTDMA", 1, 1,
|
||||
m->dma_cfg.xin_id);
|
||||
|
||||
if (!addr || !m || !dev) {
|
||||
DRM_DEBUG("invalid addr %pK catalog %pK dev %pK\n", addr, m,
|
||||
dev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!m->reg_dma_count)
|
||||
return 0;
|
||||
|
||||
|
Reference in New Issue
Block a user