summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2015-07-16 15:38:56 -0700
committerEric Anholt <eric@anholt.net>2015-07-17 12:40:46 -0700
commit753855a758f134330d3befecb48b11a2a1ef2f2e (patch)
treea9b39952f64ca7b77d7eb4f58892fe7b710ab0b7
parent6d6da92cc798f3905b05256e2b261106407a32cf (diff)
downloadlinux-753855a758f134330d3befecb48b11a2a1ef2f2e.tar.gz
drm/vc4: Make sure we don't leak the shader validation state.
This might happen if we fail to get a cache list to put the BO on. (quite unlikely). Signed-off-by: Eric Anholt <eric@anholt.net>
-rw-r--r--drivers/gpu/drm/vc4/vc4_bo.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/vc4/vc4_bo.c b/drivers/gpu/drm/vc4/vc4_bo.c
index 4340dd53c58b..8d496b32db1b 100644
--- a/drivers/gpu/drm/vc4/vc4_bo.c
+++ b/drivers/gpu/drm/vc4/vc4_bo.c
@@ -51,6 +51,9 @@ bo_page_index(size_t size)
static void
vc4_bo_destroy(struct vc4_bo *bo)
{
+ kfree(bo->validated_shader);
+ bo->validated_shader = NULL;
+
bo_stats.num_allocated--;
bo_stats.size_allocated -= bo->base.base.size;
drm_gem_cma_free_object(&bo->base.base);