]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - ipc/ipcdev.git/commitdiff
SDOCM00115110 GateMP_open crashes on Keystone 2 3.35 ipc-3.35-next 3.35.01.06_eng 3.35.01.07
authorRamsey Harris <ramsey@ti.com>
Fri, 6 Mar 2015 00:51:08 +0000 (16:51 -0800)
committerRobert Tivy <rtivy@ti.com>
Fri, 6 Mar 2015 01:33:18 +0000 (17:33 -0800)
NameServer_get takes an array of procIds. The last element in the
array must be MultiProc_INVALIDID (the array size is not known).
However, several places in IPC call this function and pass an array
which does not have the last entry marker. NameServer_get had a check
to stop iterating when the number of processors in the cluster had
been reached. I removed this check. I'm now restoring this check.

packages/ti/sdo/utils/NameServer.c

index 97303bc0e6526b818a7590279bc05f3716f92820..55240befe12445bf207eaeacab3920c3ab1b265d 100644 (file)
@@ -348,6 +348,7 @@ Int NameServer_get(NameServer_Handle handle, String name, Ptr value,
     UInt16 baseId;
     UInt16 length;
     UInt16 index;
     UInt16 baseId;
     UInt16 length;
     UInt16 index;
+    UInt16 cluster;
 
     Error_init(&eb);
 
 
     Error_init(&eb);
 
@@ -401,8 +402,9 @@ Int NameServer_get(NameServer_Handle handle, String name, Ptr value,
          *  somewhere in the list.
          */
         status = NameServer_E_NOTFOUND;
          *  somewhere in the list.
          */
         status = NameServer_E_NOTFOUND;
+        cluster = MultiProc_getNumProcsInCluster();
 
 
-        for (i = 0; procId[i] != MultiProc_INVALIDID; i++) {
+        for (i = 0; (procId[i] != MultiProc_INVALIDID) && (i < cluster); i++) {
             if (procId[i] == MultiProc_self()) {
                 /* check local */
                 status = NameServer_getLocal(handle, name, value, len);
             if (procId[i] == MultiProc_self()) {
                 /* check local */
                 status = NameServer_getLocal(handle, name, value, len);