Commit e7905855 authored by Philippe Gerum's avatar Philippe Gerum Committed by Jan Kiszka
Browse files

vxworks/mempart: fix error status upon failure to create partition


Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
Signed-off-by: Jan Kiszka's avatarJan Kiszka <jan.kiszka@siemens.com>
parent 903b21fe
...@@ -48,17 +48,21 @@ PART_ID memPartCreate(char *pPool, unsigned int poolSize) ...@@ -48,17 +48,21 @@ PART_ID memPartCreate(char *pPool, unsigned int poolSize)
pthread_mutexattr_t mattr; pthread_mutexattr_t mattr;
struct wind_mempart *mp; struct wind_mempart *mp;
struct service svc; struct service svc;
int ret;
CANCEL_DEFER(svc); CANCEL_DEFER(svc);
mp = xnmalloc(sizeof(*mp)); mp = xnmalloc(sizeof(*mp));
if (mp == NULL) if (mp == NULL) {
errno = S_memLib_NOT_ENOUGH_MEMORY;
goto fail; goto fail;
}
if (__heapobj_init(&mp->hobj, NULL, poolSize, pPool)) { ret = __heapobj_init(&mp->hobj, NULL, poolSize, pPool);
if (ret) {
xnfree(mp); xnfree(mp);
errno = S_memLib_INVALID_NBYTES;
fail: fail:
errno = S_memLib_NOT_ENOUGH_MEMORY;
CANCEL_RESTORE(svc); CANCEL_RESTORE(svc);
return (PART_ID)0; return (PART_ID)0;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment