Skip to contentSkip to conversation

drm/radeon: avoid leaking const ib (not used yet on si and newer GPU)

PATCH In review [email protected] 2 participants 2 messages May 2, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/radeon: avoid leaking const ib (not used yet on si and newer GPU)

From: Jerome Glisse <[email protected]>

---
 drivers/gpu/drm/radeon/radeon_cs.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
drivers/gpu/drm/radeon/radeon_cs.c +5 -0
index 82f2e7b0..b3800cb 100644
@@ -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;
@@ -318,6 +320,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,
Signature · 1 line
1.7.7.6
Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · On Wed, May 2, 2012 at 4:24 PM, <[email protected]> wrote:

From: Jerome Glisse <[email protected]>

Quoted 34 lines

---
 drivers/gpu/drm/radeon/radeon_cs.c |    5 +++++

 1 files changed, 5 insertions(+), 0 deletions(-)
drivers/gpu/drm/radeon/radeon_cs.c +5 -1
index 82f2e7b0..b3800cb 100644
@@ -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;
@@ -318,6 +320,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,
--

1.7.7.6

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel