Merge "Fix an out-of-bounds read in assoc_next." am: 4a86774d36 am: 64d8ff4eef am: 36e2bce0d3 am: bd26a64425

Original change: https://android-review.googlesource.com/c/device/linaro/dragonboard/+/1468267

Change-Id: Ie4647f73e693fb9241032cb17576d90e9a5ec1bb
diff --git a/qcom/pd-mapper/assoc.c b/qcom/pd-mapper/assoc.c
index 692c882..460f0d0 100644
--- a/qcom/pd-mapper/assoc.c
+++ b/qcom/pd-mapper/assoc.c
@@ -128,7 +128,7 @@
 {
 	unsigned long it = *iter;
 
-	while (!assoc->keys[it] && it < assoc->size)
+	while (it < assoc->size && !assoc->keys[it])
 		it++;
 
 	if (it == assoc->size)