Prevent %-by-0 in Assert_isTrue() expressions
[ipc/ipcdev.git] / packages / ti / sdo / ipc / transports / TransportShm.c
index 75d3ad41dc5c4b63d6284ef10cc01eede1871f46..b3475f915a0233246f95bbdcd3d0790e75845384 100644 (file)
@@ -178,7 +178,8 @@ Int TransportShm_Instance_init(TransportShm_Object *obj,
                 ti_sdo_ipc_Ipc_A_addrNotInSharedRegion);
 
         /* Assert that sharedAddr is cache aligned */
-        Assert_isTrue(((UInt32)params->sharedAddr %
+        Assert_isTrue(SharedRegion_getCacheLineSize(obj->regionId) == 0 ||
+                ((UInt32)params->sharedAddr %
                 SharedRegion_getCacheLineSize(obj->regionId) == 0),
                 ti_sdo_ipc_Ipc_A_addrNotCacheAligned);