summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerome Glisse <jglisse@redhat.com>2012-05-02 16:24:40 -0400
committerDave Airlie <airlied@redhat.com>2012-05-03 09:18:47 +0100
commitb7f6413a731f2139041beede539149a5374860fe (patch)
tree980115cf74f5131978a43323223ca974dedba46d
parent43caf4515c327dac6c69bfd6080b529eb6a049a6 (diff)
downloadlinux-3.10-b7f6413a731f2139041beede539149a5374860fe.tar.gz
linux-3.10-b7f6413a731f2139041beede539149a5374860fe.tar.bz2
linux-3.10-b7f6413a731f2139041beede539149a5374860fe.zip
drm/radeon: avoid leaking const ib (not used yet on si and newer GPU)
Signed-off-by: Jerome Glisse <jglisse@redhat.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--drivers/gpu/drm/radeon/radeon_cs.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_cs.c b/drivers/gpu/drm/radeon/radeon_cs.c
index 02eee4bb6a8..c66beb1662b 100644
--- a/drivers/gpu/drm/radeon/radeon_cs.c
+++ b/drivers/gpu/drm/radeon/radeon_cs.c
@@ -161,6 +161,8 @@ int radeon_cs_parser_init(struct radeon_cs_parser *p, void *data)
/* get chunks */
INIT_LIST_HEAD(&p->validated);
p->idx = 0;
+ p->ib = NULL;
+ p->const_ib = NULL;
p->chunk_ib_idx = -1;
p->chunk_relocs_idx = -1;
p->chunk_flags_idx = -1;
@@ -325,6 +327,9 @@ static void radeon_cs_parser_fini(struct radeon_cs_parser *parser, int error)
kfree(parser->chunks);
kfree(parser->chunks_array);
radeon_ib_free(parser->rdev, &parser->ib);
+ if (parser->const_ib) {
+ radeon_ib_free(parser->rdev, &parser->const_ib);
+ }
}
static int radeon_cs_ib_chunk(struct radeon_device *rdev,