fbdev: dpu20: fixed dpu null pointer exception
authorChiHun Won <chihun.won@samsung.com>
Sat, 7 Jul 2018 03:29:58 +0000 (12:29 +0900)
committerJungi Lee <jungilsi.lee@samsung.com>
Tue, 17 Jul 2018 10:57:15 +0000 (19:57 +0900)
Change-Id: I27906b12ddecec8744e8ab56561f13e23c8f9a25
Signed-off-by: ChiHun Won <chihun.won@samsung.com>
drivers/video/fbdev/exynos/dpu20/dsim_drv.c
drivers/video/fbdev/exynos/dpu20/fence.c
drivers/video/fbdev/exynos/dpu20/helper.c

index db0f8f477fa8572a85c1538dcdfceecf6c6b4dd4..0342404fa90bd9a8cd6a5230ce866abca1957979 100644 (file)
@@ -424,15 +424,18 @@ static void dsim_bts_print_info(struct bts_decon_info *info)
 static void dsim_underrun_info(struct dsim_device *dsim)
 {
 #if defined(CONFIG_EXYNOS_BTS)
-       struct decon_device *decon;
        int i, decon_cnt;
+       struct decon_device *decon = get_decon_drvdata(0);
 
        dsim_info("\tMIF(%lu), INT(%lu), DISP(%lu)\n",
                        cal_dfs_get_rate(ACPM_DVFS_MIF),
                        cal_dfs_get_rate(ACPM_DVFS_INT),
                        cal_dfs_get_rate(ACPM_DVFS_DISP));
 
-       decon_cnt = get_decon_drvdata(0)->dt.decon_cnt;
+       if (decon == NULL)
+               return;
+
+       decon_cnt = decon->dt.decon_cnt;
 
        for (i = 0; i < decon_cnt; ++i) {
                decon = get_decon_drvdata(i);
index 14d4132a86670e8978247b156abd8b82607cb559..9ff08bed09ef1772a374d707510d0720354b59a9 100644 (file)
@@ -299,8 +299,12 @@ void decon_wait_fence(struct dma_fence *fence)
 
 void decon_signal_fence(struct dma_fence *fence)
 {
-       if (dma_fence_signal(fence))
-               decon_warn("%s: fence[%p] #%d signal failed\n", __func__,
-                               fence, fence->seqno);
+       if (dma_fence_signal(fence)) {
+               if (fence)
+                       decon_warn("%s: fence[%p] #%d signal failed\n", __func__,
+                                       fence, fence->seqno);
+               else
+                       decon_warn("%s: fence is null\n", __func__);
+       }
 }
 #endif
index 5405128cffdc47d29ee79d0e0cae5921c8e2ff1b..a8c1bc26870a530cd4df4333f3f7fad3f782b614 100644 (file)
@@ -725,8 +725,18 @@ int dpu_pm_domain_check_status(struct exynos_pm_domain *pm_domain)
 
 void dsim_to_regs_param(struct dsim_device *dsim, struct dsim_regs *regs)
 {
-       regs->regs = dsim->res.regs;
-       regs->ss_regs = dsim->res.ss_regs;
-       regs->phy_regs = dsim->res.phy_regs;
-       regs->phy_regs_ex = dsim->res.phy_regs_ex;
+       if (dsim->res.regs)
+               regs->regs = dsim->res.regs;
+       else
+               regs->regs = NULL;
+
+       if (dsim->res.phy_regs)
+               regs->phy_regs = dsim->res.phy_regs;
+       else
+               regs->phy_regs = NULL;
+
+       if (dsim->res.phy_regs_ex)
+               regs->phy_regs_ex = dsim->res.phy_regs_ex;
+       else
+               regs->phy_regs_ex = NULL;
 }