From 461809cfedcefca4c023f3e5939a1a4a5822141d Mon Sep 17 00:00:00 2001 From: Krishna Manikandan <mkrishn@codeaurora.org> Date: Wed, 28 Dec 2016 17:45:38 +0530 Subject: [PATCH] msm: mdss: Fix potential NULL pointer dereference in mdss smmu driver FB driver will call this function even if there is no MDP. mdss_mdp_get_mdata will return NULL in that scenario and needs to be checked. Change-Id: Icebed1bc9b4da214fec2ca924590403d1656fa5d Signed-off-by: Naseer Ahmed <naseer@codeaurora.org> Signed-off-by: Krishna Manikandan <mkrishn@codeaurora.org> --- drivers/video/fbdev/msm/mdss_smmu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/fbdev/msm/mdss_smmu.h b/drivers/video/fbdev/msm/mdss_smmu.h index f7e6e275c16a..07b33a9432ae 100644 --- a/drivers/video/fbdev/msm/mdss_smmu.h +++ b/drivers/video/fbdev/msm/mdss_smmu.h @@ -247,7 +247,7 @@ static inline void mdss_smmu_dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, dma_addr_t phys, dma_addr_t iova, int domain) { struct mdss_data_type *mdata = mdss_mdp_get_mdata(); - if (mdata->smmu_ops.smmu_dma_free_coherent) + if (mdata && mdata->smmu_ops.smmu_dma_free_coherent) mdata->smmu_ops.smmu_dma_free_coherent(dev, size, cpu_addr, phys, iova, domain); }