Resolved SDOCM00119205: Infinite loop due to improper cache handling when using Share...
authorJustin Sobota <jsobota@ti.com>
Fri, 30 Oct 2015 19:43:38 +0000 (15:43 -0400)
committerJustin Sobota <jsobota@ti.com>
Fri, 30 Oct 2015 19:43:38 +0000 (15:43 -0400)
Signed-off-by: Justin Sobota <jsobota@ti.com>
src/rm_allocator.c

index e803b65c4eb0a1113882ade56aa0cd7455d031fd..242fd3d0a1d10c51bc2ab98eb296c89b09ba3970 100644 (file)
@@ -551,9 +551,16 @@ static int32_t allocatorPreAllocate(Rm_Handle rmHandle,
                         findNode.base += findNode.length;
                     } else {
                         /* Matching node allocated, move to next node */
-                        if ((nextNode = RB_NEXT(_Rm_AllocatorResourceTree,
-                                                allocator->resourceRoot,
-                                                matchingNode))) {
+                        if (rmInst->instType == Rm_instType_SHARED_SERVER) {
+                            nextNode = RB_NEXT_CACHED(_Rm_AllocatorResourceTree,
+                                                      allocator->resourceRoot,
+                                                      matchingNode);
+                        } else {
+                            nextNode = RB_NEXT(_Rm_AllocatorResourceTree,
+                                               allocator->resourceRoot,
+                                               matchingNode);
+                        }
+                        if (nextNode) {
                             findNode.base = nextNode->base;
                         } else {
                             retVal = RM_SERVICE_DENIED_RES_ALLOC_REQS_NOT_MET;