drm/vc4: crtc: Add null pointer error handling
Crash occurs when vc4_encoder is null. Add null error handling
Unable to handle kernel NULL pointer dereference at virtual address
0000000000000090
Mem abort info:
ESR = 0x96000005
EC = 0x25: DABT (current EL), IL = 32 bits
SET = 0, FnV = 0
EA = 0, S1PTW = 0
Data abort info:
ISV = 0, ISS = 0x00000005
CM = 0, WnR = 0
user pgtable: 4k pages, 39-bit VAs, pgdp=
00000000f2a96000
[
0000000000000090] pgd=
0000000000000000, pud=
0000000000000000
Internal error: Oops:
96000005 [#1] PREEMPT SMP
Modules linked in: brcmfmac joydev brcmutil rpivid_mem
CPU: 0 PID: 32 Comm: kworker/0:1 Not tainted 5.4.50-v8+ #414
Hardware name: Raspberry Pi 4 Model B (DT)
Workqueue: events output_poll_execute
pstate:
80000005 (Nzcv daif -PAN -UAO)
pc : vc4_crtc_atomic_disable+0x150/0x2e8
lr : vc4_crtc_atomic_disable+0x50/0x2e8
...
Call trace:
vc4_crtc_atomic_disable+0x150/0x2e8
drm_atomic_helper_commit_modeset_disables+0x344/0x410
vc4_atomic_complete_commit+0xd4/0x530
vc4_atomic_commit+0xf4/0x190
drm_atomic_commit+0x54/0x60
...
Change-Id: Ib3271bb3c8318079fe5815711f89a217e835adc6
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>