There is no drvdata for specific instance of dpp when it is not
assigned from dt, and accessing it without null check causes null
pointer deference. Fix the null pointer defercens when accessing
recovery_cnt.
Change-Id: Ie57024101d461b1135f341bd1f76b55d0d77ec73
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
dpp_info("dma%d recovery start(0x%x).. [src=%s], cnt[%d %d]\n",
dpp->id, irqs,
val == DPP_COMP_SRC_G2D ? "G2D" : "GPU",
- get_dpp_drvdata(IDMA_VGF0)->d.recovery_cnt,
- get_dpp_drvdata(IDMA_VGF1)->d.recovery_cnt);
+ (get_dpp_drvdata(IDMA_VGF0) ?
+ get_dpp_drvdata(IDMA_VGF0)->d.recovery_cnt :
+ 0),
+ (get_dpp_drvdata(IDMA_VGF1) ?
+ get_dpp_drvdata(IDMA_VGF1)->d.recovery_cnt :
+ 0));
goto irq_end;
}
static int decon_debug_rec_show(struct seq_file *s, void *unused)
{
seq_printf(s, "VGF0[%u] VGF1[%u]\n",
- get_dpp_drvdata(IDMA_VGF0)->d.recovery_cnt,
- get_dpp_drvdata(IDMA_VGF1)->d.recovery_cnt);
+ (get_dpp_drvdata(IDMA_VGF0) ?
+ get_dpp_drvdata(IDMA_VGF0)->d.recovery_cnt : 0),
+ (get_dpp_drvdata(IDMA_VGF1) ?
+ get_dpp_drvdata(IDMA_VGF1)->d.recovery_cnt : 0));
return 0;
}