summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Hellstrom <thellstrom-at-vmware-dot-com>2009-04-08 11:37:26 +0200
committerThomas Hellstrom <thellstrom-at-vmware-dot-com>2009-04-08 11:39:08 +0200
commit308bb6726002056ccd7c89f7942f10ebc7d43ca9 (patch)
tree29894cd76c739590b192f7b25f7e18b65fb66c11
parenteb8948567f7050b9dba78f196e5251e697927368 (diff)
Fix valgrind warnings.
Signed-off-by: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
-rw-r--r--src/wsbm_slabpool.c11
-rw-r--r--src/wsbm_ttmpool.c8
2 files changed, 17 insertions, 2 deletions
diff --git a/src/wsbm_slabpool.c b/src/wsbm_slabpool.c
index abab436..99f8d22 100644
--- a/src/wsbm_slabpool.c
+++ b/src/wsbm_slabpool.c
@@ -241,6 +241,7 @@ wsbmFreeKernelBO(struct _WsbmSlabKernelBO *kbo)
return;
slabPool = kbo->slabPool;
+ memset(&arg, 0, sizeof(arg));
arg.handle = kbo->kBuf.handle;
(void)munmap(kbo->virtual, kbo->actualSize);
(void)drmCommandWrite(slabPool->pool.fd,
@@ -369,6 +370,7 @@ wsbmAllocKernelBO(struct _WsbmSlabSizeHeader *header)
struct ttm_pl_setstatus_req *req = &arg.req;
struct ttm_pl_rep *rep = &arg.rep;
+ memset(&arg, 0, sizeof(arg));
req->handle = kbo->kBuf.handle;
req->set_placement = slabPool->proposedPlacement & new_mask;
req->clr_placement = ~slabPool->proposedPlacement & new_mask;
@@ -401,6 +403,7 @@ wsbmAllocKernelBO(struct _WsbmSlabSizeHeader *header)
WSBMINITLISTHEAD(&kbo->head);
WSBMINITLISTHEAD(&kbo->timeoutHead);
+ memset(&arg, 0, sizeof(arg));
arg.req.size = size;
arg.req.placement = slabPool->proposedPlacement;
arg.req.page_alignment = slabPool->pageAlignment;
@@ -433,8 +436,10 @@ wsbmAllocKernelBO(struct _WsbmSlabSizeHeader *header)
out_err1:
{
- struct ttm_pl_reference_req arg = {.handle = kbo->kBuf.handle };
+ struct ttm_pl_reference_req arg;
+ memset(&arg, 0, sizeof(arg));
+ arg.handle = kbo->kBuf.handle;
(void)drmCommandWrite(slabPool->pool.fd,
slabPool->devOffset + TTM_PL_UNREF,
&arg, sizeof(arg));
@@ -746,7 +751,7 @@ pool_create(struct _WsbmBufferPool *pool, unsigned long size,
{
union ttm_pl_create_arg arg;
- arg.req.size = size;
+ memset(&arg, 0, sizeof(arg));
arg.req.placement = placement;
arg.req.page_alignment = alignment / slabPool->pageSize;
@@ -776,6 +781,7 @@ pool_create(struct _WsbmBufferPool *pool, unsigned long size,
{
struct ttm_pl_reference_req arg;
+ memset(&arg, 0, sizeof(arg));
arg.handle = sBuf->kBuf.handle;
(void)drmCommandWriteRead(pool->fd,
slabPool->devOffset + TTM_PL_UNREF,
@@ -809,6 +815,7 @@ pool_destroy(struct _WsbmBufStorage **p_buf)
sBuf->virtual = NULL;
}
+ memset(&arg, 0, sizeof(arg));
arg.handle = sBuf->kBuf.handle;
(void)drmCommandWrite(slabPool->pool.fd,
slabPool->devOffset + TTM_PL_UNREF,
diff --git a/src/wsbm_ttmpool.c b/src/wsbm_ttmpool.c
index 5867428..4b8c6a2 100644
--- a/src/wsbm_ttmpool.c
+++ b/src/wsbm_ttmpool.c
@@ -131,6 +131,7 @@ pool_create(struct _WsbmBufferPool *pool,
if (ret)
goto out_err1;
+ memset(&arg, 0, sizeof(arg));
arg.req.size = size;
arg.req.placement = placement;
arg.req.page_alignment = alignment / pageSize;
@@ -178,6 +179,7 @@ pool_reference(struct _WsbmBufferPool *pool, unsigned handle)
if (ret)
goto out_err1;
+ memset(&arg, 0, sizeof(arg));
arg.req.handle = handle;
ret = drmCommandWriteRead(pool->fd, ttmPool->devOffset + TTM_PL_REFERENCE,
&arg, sizeof(arg));
@@ -216,6 +218,8 @@ pool_destroy(struct _WsbmBufStorage **buf)
(void)munmap(dBuf->virtual, dBuf->requestedSize);
dBuf->virtual = NULL;
}
+
+ memset(&arg, 0, sizeof(arg));
arg.handle = dBuf->kBuf.handle;
(void)drmCommandWrite(dBuf->buf.pool->fd,
ttmPool->devOffset + TTM_PL_UNREF,
@@ -263,6 +267,7 @@ syncforcpu_locked(struct _WsbmBufStorage *buf, unsigned mode)
WSBM_MUTEX_UNLOCK(&buf->mutex);
+ memset(&arg, 0, sizeof(arg));
arg.handle = dBuf->kBuf.handle;
arg.access_mode = kmode;
arg.op = TTM_PL_SYNCCPU_OP_GRAB;
@@ -303,6 +308,7 @@ releasefromcpu_locked(struct _WsbmBufStorage *buf, unsigned mode)
if (kmode) {
struct ttm_pl_synccpu_arg arg;
+ memset(&arg, 0, sizeof(arg));
arg.handle = dBuf->kBuf.handle;
arg.access_mode = kmode;
arg.op = TTM_PL_SYNCCPU_OP_RELEASE;
@@ -420,6 +426,7 @@ pool_waitIdle(struct _WsbmBufStorage *buf, int lazy)
struct _WsbmBufferPool *pool = buf->pool;
int ret;
+ memset(&req, 0, sizeof(req));
req.handle = dBuf->kBuf.handle;
req.mode = (lazy) ? TTM_PL_WAITIDLE_MODE_LAZY : 0;
@@ -449,6 +456,7 @@ pool_setStatus(struct _WsbmBufStorage *buf, uint32_t set_placement,
struct _WsbmBufferPool *pool = buf->pool;
int ret;
+ memset(&arg, 0, sizeof(arg));
req->handle = dBuf->kBuf.handle;
req->set_placement = set_placement;
req->clr_placement = clr_placement;