diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2009-07-30 00:32:08 +0200 |
---|---|---|
committer | Thomas Hellstrom <thellstrom@vmware.com> | 2009-08-04 10:22:10 +0200 |
commit | 00f1813c2dcccf99e5cabaf8bb15679eaeacd816 (patch) | |
tree | 7c3279772742555801cd91c73af6377d5967dc85 | |
parent | 73822d3a7699670149613be030bb7ce7f14211f8 (diff) |
userpool: check wsbmBufStorageInit returned value
-rw-r--r-- | src/wsbm_userpool.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/wsbm_userpool.c b/src/wsbm_userpool.c index f7833b7..c8fb95b 100644 --- a/src/wsbm_userpool.c +++ b/src/wsbm_userpool.c @@ -206,11 +206,15 @@ pool_create(struct _WsbmBufferPool *pool, { struct _WsbmUserPool *p = containerOf(pool, struct _WsbmUserPool, pool); struct _WsbmUserBuffer *vBuf = calloc(1, sizeof(*vBuf)); + int ret; if (!vBuf) return NULL; - wsbmBufStorageInit(&vBuf->buf, pool); + ret = wsbmBufStorageInit(&vBuf->buf, pool); + if (ret) + goto out_err; + vBuf->sysmem = NULL; vBuf->proposedPlacement = placement; vBuf->size = size; @@ -264,6 +268,7 @@ pool_create(struct _WsbmBufferPool *pool, if (vBuf->sysmem != NULL || (!(vBuf->kBuf.placement & WSBM_PL_FLAG_SYSTEM))) return &vBuf->buf; + out_err: free(vBuf); return NULL; |