gpu: drm: verisilicon: Fix potential Null pointer dereference 42/296342/2
authorJaehoon Chung <jh80.chung@samsung.com>
Wed, 26 Jul 2023 01:50:50 +0000 (10:50 +0900)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Wed, 26 Jul 2023 04:59:19 +0000 (04:59 +0000)
It can be the poential NULL pointer dereference.

[    3.749753] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000008
[    3.750873] starfive display-subsystem: bound 29400000.dc8200 (ops 0xffffffff812c3bc8)
[    3.758534] Oops [#1]
[    3.758538] Modules linked in:
[    3.758547] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 6.1.39-riscv-visionfive2 #1
[    3.758555] Hardware name: StarFive VisionFive 2 v1.3B (DT)
[    3.758560] epc : dc_isr+0x22/0x60
[    3.766483] innohdmi-starfive 29590000.hdmi: inno hdmi bind begin
[    3.768725]  ra : dc_isr+0x22/0x60
[    3.768734] epc : ffffffff806db7ee ra : ffffffff806db7ee sp : ffffffff81a03bf0
[    3.768741]  gp : ffffffff81c6a158 tp : ffffffff81a17900 t0 : 0000000000046000
[    3.771834] innohdmi-starfive 29590000.hdmi: supply hdmi_1p8 not found, using dummy regulator

Change-Id: I4a7c1f656f1d45c2fc183f2c2976a11e0b2816c1
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
drivers/gpu/drm/verisilicon/vs_dc.c

index 12c09da..7c7b72c 100644 (file)
@@ -806,6 +806,9 @@ static irqreturn_t dc_isr(int irq, void *data)
        struct vs_dc_info *dc_info = dc->hw.info;
        u32 i, ret;
 
+       if (!dc_info)
+               return IRQ_HANDLED;
+
        ret = dc_hw_get_interrupt(&dc->hw);
 
        for (i = 0; i < dc_info->panel_num; i++)