r600g: use calloc for ctx bo allocations
authorDave Airlie <airlied@redhat.com>
Fri, 17 Sep 2010 05:27:58 +0000 (15:27 +1000)
committerDave Airlie <airlied@redhat.com>
Fri, 17 Sep 2010 05:29:32 +0000 (15:29 +1000)
since the reference code relies on these being NULL.

src/gallium/winsys/r600/drm/radeon_ctx.c

index ca3e40ffdc10d7a57796bafd500b5f65e31a7971..7ccb52459055729b564f3916619e3a5a3cd3bb3d 100644 (file)
@@ -86,7 +86,7 @@ struct radeon_ctx *radeon_ctx_init(struct radeon *radeon)
                radeon_ctx_fini(ctx);
                return NULL;
        }
-       ctx->bo = malloc(sizeof(void *) * RADEON_CTX_MAX_PM4);
+       ctx->bo = calloc(sizeof(void *), RADEON_CTX_MAX_PM4);
        if (ctx->bo == NULL) {
                radeon_ctx_fini(ctx);
                return NULL;