build: Resolve array index out-of-bound warning [1/1]
authorChia-hung Duan <chiahungduan@google.com>
Wed, 3 Jul 2019 06:43:57 +0000 (14:43 +0800)
committerShuide Chen <shuide.chen@amlogic.com>
Thu, 25 Jul 2019 02:12:09 +0000 (19:12 -0700)
PD#SWPL-8241

Problem:
** SYNC FROM GOOGLE **
Build failed due to uninitialzed variable

Solution:
Add assertion as guard

Verify:
Build with Android prebuilt toolchain

Change-Id: Iaf84c857e23c9552bc44f4924bda0510c39e0a32

dvalin/kernel/drivers/gpu/arm/midgard/backend/gpu/mali_kbase_mmu_hw_direct.c

index ba5bf721e5235f01b478f8330b109e4101dc8803..120de4df1f34c37ecb403f88c665fd7f30be5c00 100755 (executable)
@@ -157,6 +157,7 @@ void kbase_mmu_interrupt(struct kbase_device *kbdev, u32 irq_stat)
                 * for not-found here
                 */
                as_no = ffs(bf_bits | pf_bits) - 1;
+               KBASE_DEBUG_ASSERT(as_no >= 0);
                as = &kbdev->as[as_no];
 
                /* find the fault type */