summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gray <jsg@jsg.id.au>2013-06-07 15:37:11 +1000
committerJonathan Gray <jsg@jsg.id.au>2013-08-12 10:42:14 +1000
commitb60bf2694506412bd0b5b80a9b404cd3bfc75243 (patch)
tree02e298aa53cde566fbdfc39020d75566b20dc854
parent2e519d60bb24d1abcbc801dade6dca47cd143d3f (diff)
convert some free() use to drm_free() which checks for NULL
-rw-r--r--sys/dev/pci/drm/radeon/radeon_cs.c20
-rw-r--r--sys/dev/pci/drm/radeon/radeon_fence.c2
2 files changed, 11 insertions, 11 deletions
diff --git a/sys/dev/pci/drm/radeon/radeon_cs.c b/sys/dev/pci/drm/radeon/radeon_cs.c
index fd4ea45dd21..54be6800511 100644
--- a/sys/dev/pci/drm/radeon/radeon_cs.c
+++ b/sys/dev/pci/drm/radeon/radeon_cs.c
@@ -284,8 +284,8 @@ int radeon_cs_parser_init(struct radeon_cs_parser *p, void *data)
p->chunks[p->chunk_ib_idx].kpage[1] = malloc(PAGE_SIZE, M_DRM, M_WAITOK);
if (p->chunks[p->chunk_ib_idx].kpage[0] == NULL ||
p->chunks[p->chunk_ib_idx].kpage[1] == NULL) {
- free(p->chunks[p->chunk_ib_idx].kpage[0], M_DRM);
- free(p->chunks[p->chunk_ib_idx].kpage[1], M_DRM);
+ drm_free(p->chunks[p->chunk_ib_idx].kpage[0]);
+ drm_free(p->chunks[p->chunk_ib_idx].kpage[1]);
p->chunks[p->chunk_ib_idx].kpage[0] = NULL;
p->chunks[p->chunk_ib_idx].kpage[1] = NULL;
return -ENOMEM;
@@ -326,18 +326,18 @@ static void radeon_cs_parser_fini(struct radeon_cs_parser *parser, int error)
drm_gem_object_unreference_unlocked(parser->relocs[i].gobj);
}
}
- free(parser->track, M_DRM);
- free(parser->relocs, M_DRM);
- free(parser->relocs_ptr, M_DRM);
+ drm_free(parser->track);
+ drm_free(parser->relocs);
+ drm_free(parser->relocs_ptr);
for (i = 0; i < parser->nchunks; i++) {
- free(parser->chunks[i].kdata, M_DRM);
+ drm_free(parser->chunks[i].kdata);
if ((parser->rdev->flags & RADEON_IS_AGP)) {
- free(parser->chunks[i].kpage[0], M_DRM);
- free(parser->chunks[i].kpage[1], M_DRM);
+ drm_free(parser->chunks[i].kpage[0]);
+ drm_free(parser->chunks[i].kpage[1]);
}
}
- free(parser->chunks, M_DRM);
- free(parser->chunks_array, M_DRM);
+ drm_free(parser->chunks);
+ drm_free(parser->chunks_array);
radeon_ib_free(parser->rdev, &parser->ib);
radeon_ib_free(parser->rdev, &parser->const_ib);
}
diff --git a/sys/dev/pci/drm/radeon/radeon_fence.c b/sys/dev/pci/drm/radeon/radeon_fence.c
index c19c1e7f419..4fe71970e51 100644
--- a/sys/dev/pci/drm/radeon/radeon_fence.c
+++ b/sys/dev/pci/drm/radeon/radeon_fence.c
@@ -204,7 +204,7 @@ void radeon_fence_process(struct radeon_device *rdev, int ring)
static void radeon_fence_destroy(struct radeon_fence *fence)
{
- free(fence, M_DRM);
+ drm_free(fence);
}
/**