2016-07-07 07:22:07 +00:00
|
|
|
From 5c182b5f46cb781e945b3e567ac97fbb369d75d4 Mon Sep 17 00:00:00 2001
|
2016-04-24 11:03:39 +00:00
|
|
|
From: Dan Carpenter <dan.carpenter@oracle.com>
|
|
|
|
Date: Thu, 17 Dec 2015 15:39:08 +0300
|
2016-07-07 07:22:07 +00:00
|
|
|
Subject: [PATCH 272/423] drm/vc4: allocate enough memory in
|
2016-04-24 11:03:39 +00:00
|
|
|
vc4_save_hang_state()
|
|
|
|
|
|
|
|
"state" is smaller than "kernel_state" so we end up corrupting memory.
|
|
|
|
|
|
|
|
Fixes: 214613656b51 ('drm/vc4: Add an interface for capturing the GPU state after a hang.')
|
|
|
|
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
|
|
|
|
Reviewed-by: Eric Anholt <eric@anholt.net>
|
|
|
|
(cherry picked from commit 7e5082fbc00cc157e57a70cdb6b9bbb21289afb1)
|
|
|
|
---
|
|
|
|
drivers/gpu/drm/vc4/vc4_gem.c | 2 +-
|
|
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
|
|
|
|
--- a/drivers/gpu/drm/vc4/vc4_gem.c
|
|
|
|
+++ b/drivers/gpu/drm/vc4/vc4_gem.c
|
|
|
|
@@ -159,7 +159,7 @@ vc4_save_hang_state(struct drm_device *d
|
|
|
|
unsigned long irqflags;
|
|
|
|
unsigned int i, unref_list_count;
|
|
|
|
|
|
|
|
- kernel_state = kcalloc(1, sizeof(*state), GFP_KERNEL);
|
|
|
|
+ kernel_state = kcalloc(1, sizeof(*kernel_state), GFP_KERNEL);
|
|
|
|
if (!kernel_state)
|
|
|
|
return;
|
|
|
|
|