summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/common/utils.c2
-rw-r--r--src/mesa/drivers/dri/i965/brw_state_cache.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/common/utils.c b/src/mesa/drivers/dri/common/utils.c
index e0b3db8cf14..f2e63c0b98c 100644
--- a/src/mesa/drivers/dri/common/utils.c
+++ b/src/mesa/drivers/dri/common/utils.c
@@ -238,7 +238,7 @@ driCreateConfigs(mesa_format format,
is_srgb = _mesa_get_format_color_encoding(format) == GL_SRGB;
num_modes = num_depth_stencil_bits * num_db_modes * num_accum_bits * num_msaa_modes;
- configs = calloc(1, (num_modes + 1) * sizeof *configs);
+ configs = calloc(num_modes + 1, sizeof *configs);
if (configs == NULL)
return NULL;
diff --git a/src/mesa/drivers/dri/i965/brw_state_cache.c b/src/mesa/drivers/dri/i965/brw_state_cache.c
index 19079c8b2cc..bb5047ea4d6 100644
--- a/src/mesa/drivers/dri/i965/brw_state_cache.c
+++ b/src/mesa/drivers/dri/i965/brw_state_cache.c
@@ -115,7 +115,7 @@ rehash(struct brw_cache *cache)
GLuint size, i;
size = cache->size * 3;
- items = calloc(1, size * sizeof(*items));
+ items = calloc(size, sizeof(*items));
for (i = 0; i < cache->size; i++)
for (c = cache->items[i]; c; c = next) {
@@ -334,7 +334,7 @@ brw_init_caches(struct brw_context *brw)
cache->size = 7;
cache->n_items = 0;
cache->items =
- calloc(1, cache->size * sizeof(struct brw_cache_item *));
+ calloc(cache->size, sizeof(struct brw_cache_item *));
cache->bo = drm_intel_bo_alloc(brw->bufmgr,
"program cache",