Commit f61bb9d1 authored by Tri Vo's avatar Tri Vo
Browse files

ANDROID: trusty: Add missing NULL checks to trusty-virtio.c



Check if virtqueue was created before touching it. Otherwise, if
trusty-virtio.ko is loaded before trusty-ipc.ko, kernel panics with the
following trace:

[    1.550733] CPU: 1 PID: 7 Comm: kworker/u8:0 Not tainted 5.4.46-00188-g939619581245-dirty #10
[    1.552811] Hardware name: linux,dummy-virt (DT)
[    1.555320] Workqueue: trusty-check-wq check_all_vqs
[    1.555996] pstate: 20400005 (nzCv daif +PAN -UAO)
[    1.557575] pc : vring_interrupt+0x10/0xd4
[    1.558004] lr : check_all_vqs+0x48/0x70
...
[    1.567712] Call trace:
[    1.567901]  vring_interrupt+0x10/0xd4
[    1.568086]  check_all_vqs+0x48/0x70
[    1.568420]  process_one_work+0x270/0x474
[    1.568439]  worker_thread+0x288/0x4e4
[    1.568453]  kthread+0x114/0x124
[    1.568480]  ret_from_fork+0x10/0x18
[    1.569764] Code: f800865e a9be7bfd f9000bf3 910003fd (3940e029)
[    1.570468] ---[ end trace 2fde04f3a63b631d ]---
[    1.571115] Kernel panic - not syncing: Fatal exception
[    1.571768] SMP: stopping secondary CPUs
[    1.572542] Kernel Offset: disabled
[    1.573217] CPU features: 0x000000

Bug: 168322325
Change-Id: Idc88aca6fb8b1f9f5b0a6a538e9ccd77b153b2fe
Signed-off-by: default avatarTri Vo <trong@google.com>
parent 60bdaaac
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment