Added local gate for NULL service callback and fixed bug where resource node offset...
[keystone-rtos/rm-lld.git] / src / rm_policy.c
index 8f39d55c2ab4a9faf775601d85f0fcc6e861f1f5..8e2a7c74e9a9d54dbc5ed15755aac831cf1cf14b 100644 (file)
@@ -767,6 +767,11 @@ int32_t rmPolicyGetResourceOffset(void *policyDtb, char *resourceName)
             break;
         }
     }
+
+    if (depth < RM_DTB_UTIL_STARTING_DEPTH) {
+        /* Resource name not found */
+        nodeOffset = RM_SERVICE_DENIED_RES_DOES_NOT_EXIST;
+    }
     return(nodeOffset);
 }