summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2009-07-30 00:42:02 +0200
committerThomas Hellstrom <thellstrom@vmware.com>2009-08-04 10:22:21 +0200
commit9454f3f44be232f503ec77c66ef9ed4723708d22 (patch)
tree0ea777150110b4be74c25bb304c546d97c9f7b64
parent00f1813c2dcccf99e5cabaf8bb15679eaeacd816 (diff)
userpool: initialize and free vBuf->eventwsbm-1-branch
-rw-r--r--src/wsbm_userpool.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/wsbm_userpool.c b/src/wsbm_userpool.c
index c8fb95b..d945129 100644
--- a/src/wsbm_userpool.c
+++ b/src/wsbm_userpool.c
@@ -213,7 +213,11 @@ pool_create(struct _WsbmBufferPool *pool,
ret = wsbmBufStorageInit(&vBuf->buf, pool);
if (ret)
- goto out_err;
+ goto out_err0;
+
+ ret = WSBM_COND_INIT(&vBuf->event);
+ if (ret)
+ goto out_err1;
vBuf->sysmem = NULL;
vBuf->proposedPlacement = placement;
@@ -255,7 +259,7 @@ pool_create(struct _WsbmBufferPool *pool,
if ((placement & WSBM_PL_FLAG_NO_EVICT)
&& !(placement & WSBM_PL_FLAG_SYSTEM)) {
WSBM_MUTEX_UNLOCK(&p->mutex);
- goto out_err;
+ goto out_err2;
}
vBuf->sysmem = malloc(size + WSBM_USER_ALIGN_ADD);
@@ -269,7 +273,11 @@ pool_create(struct _WsbmBufferPool *pool,
|| (!(vBuf->kBuf.placement & WSBM_PL_FLAG_SYSTEM)))
return &vBuf->buf;
- out_err:
+ out_err2:
+ WSBM_COND_FREE(&vBuf->event);
+ out_err1:
+ wsbmBufStorageTakedown(&vBuf->buf);
+ out_err0:
free(vBuf);
return NULL;
}
@@ -448,6 +456,8 @@ pool_destroy(struct _WsbmBufStorage **buf)
else
free(vBuf->sysmem);
+ WSBM_COND_FREE(&vBuf->event);
+
free(vBuf);
return;
}