summaryrefslogtreecommitdiff
path: root/mali_kbase/mali_kbase_as_fault_debugfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'mali_kbase/mali_kbase_as_fault_debugfs.c')
-rw-r--r--mali_kbase/mali_kbase_as_fault_debugfs.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/mali_kbase/mali_kbase_as_fault_debugfs.c b/mali_kbase/mali_kbase_as_fault_debugfs.c
index 77f450d..ad33691 100644
--- a/mali_kbase/mali_kbase_as_fault_debugfs.c
+++ b/mali_kbase/mali_kbase_as_fault_debugfs.c
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
/*
*
- * (C) COPYRIGHT 2016-2021 ARM Limited. All rights reserved.
+ * (C) COPYRIGHT 2016-2022 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
@@ -98,11 +98,9 @@ void kbase_as_fault_debugfs_init(struct kbase_device *kbdev)
"unable to create address_spaces debugfs directory");
} else {
for (i = 0; i < kbdev->nr_hw_address_spaces; i++) {
- snprintf(as_name, ARRAY_SIZE(as_name), "as%u", i);
- debugfs_create_file(as_name, 0444,
- debugfs_directory,
- (void *)(uintptr_t)i,
- &as_fault_fops);
+ if (likely(scnprintf(as_name, ARRAY_SIZE(as_name), "as%u", i)))
+ debugfs_create_file(as_name, 0444, debugfs_directory,
+ (void *)(uintptr_t)i, &as_fault_fops);
}
}