summaryrefslogtreecommitdiff
path: root/mali_kbase/mali_kbase_debug_job_fault.c
diff options
context:
space:
mode:
Diffstat (limited to 'mali_kbase/mali_kbase_debug_job_fault.c')
-rw-r--r--mali_kbase/mali_kbase_debug_job_fault.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/mali_kbase/mali_kbase_debug_job_fault.c b/mali_kbase/mali_kbase_debug_job_fault.c
index dbc774d..5a1bc2d 100644
--- a/mali_kbase/mali_kbase_debug_job_fault.c
+++ b/mali_kbase/mali_kbase_debug_job_fault.c
@@ -1,6 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0
/*
*
- * (C) COPYRIGHT 2012-2016, 2018-2019 ARM Limited. All rights reserved.
+ * (C) COPYRIGHT 2012-2016, 2018-2020 ARM Limited. All rights reserved.
*
* This program is free software and is provided to you under the terms of the
* GNU General Public License version 2 as published by the Free Software
@@ -518,23 +519,24 @@ void kbase_debug_job_fault_dev_term(struct kbase_device *kbdev)
/*
* Initialize the relevant data structure per context
*/
-void kbase_debug_job_fault_context_init(struct kbase_context *kctx)
+int kbase_debug_job_fault_context_init(struct kbase_context *kctx)
{
/* We need allocate double size register range
* Because this memory will keep the register address and value
*/
kctx->reg_dump = vmalloc(0x4000 * 2);
- if (kctx->reg_dump == NULL)
- return;
-
- if (kbase_debug_job_fault_reg_snapshot_init(kctx, 0x4000) == false) {
- vfree(kctx->reg_dump);
- kctx->reg_dump = NULL;
+ if (kctx->reg_dump != NULL) {
+ if (kbase_debug_job_fault_reg_snapshot_init(kctx, 0x4000) ==
+ false) {
+ vfree(kctx->reg_dump);
+ kctx->reg_dump = NULL;
+ }
+ INIT_LIST_HEAD(&kctx->job_fault_resume_event_list);
+ atomic_set(&kctx->job_fault_count, 0);
}
- INIT_LIST_HEAD(&kctx->job_fault_resume_event_list);
- atomic_set(&kctx->job_fault_count, 0);
+ return 0;
}
/*