MALI: bifrost: prevent a rare null pointer exception in update_on_slot_queues_offsets()

The most recent situation is that the null pointer exception
is only reported from repeated reboot test on rk3588_EDGE_SDK,
not on rk3588_Linux_SDK or rk3588_Android_SDK.

Change-Id: I1e5ce9eb9fd32c29294e115e6014a8114c896754
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
This commit is contained in:
Zhen Chen
2022-05-19 16:06:02 +08:00
committed by Tao Huang
parent fd0f184a8e
commit 9eccd1f8a3

View File

@@ -442,10 +442,18 @@ static void update_on_slot_queues_offsets(struct kbase_device *kbdev)
struct kbase_queue *const queue = group->bound_queues[j];
if (queue) {
u64 const *const output_addr =
(u64 const *)(queue->user_io_addr + PAGE_SIZE);
if (queue->user_io_addr) {
u64 const *const output_addr =
(u64 const *)(queue->user_io_addr + PAGE_SIZE);
queue->extract_ofs = output_addr[CS_EXTRACT_LO / sizeof(u64)];
queue->extract_ofs =
output_addr[CS_EXTRACT_LO / sizeof(u64)];
} else {
dev_warn(kbdev->dev,
"%s(): queue->user_io_addr is NULL, queue: %p",
__func__,
queue);
}
}
}
}