On 04/24/15 12:19, Jerin Jacob wrote:
On Fri, Apr 24, 2015 at 11:39:58AM +0300, Maxim Uvarov wrote:
On 04/20/15 11:28, Jerin Jacob wrote:
+       /* Reserve memory for test_globals_t from shared mem */
+       shm = odp_shm_reserve("shm_test_globals", sizeof(test_globals_t),
+                             ODP_CACHE_LINE_SIZE, 0);
if (ODP_SHM_INVALID == shm)
     return -1;

+       gbls = odp_shm_addr(shm);
+
+       if (gbls == NULL) {
+               EXAMPLE_ERR("Error: shared mem alloc failed.\n");
+               return -1;
+       }
that is not needed.
This check should be required. odp_shm_addr() can return NULL.
Above proposed ODP_SHM_INVALID == shm check
may not be required as odp_shm_addr() function will return NULL if shm == 
ODP_SHM_INVALID
yes, but at least for linux-generic it does not check.

Maxim.


Thanks,
Maxim.
_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp

_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to