Commit 7e5082fb authored by Dan Carpenter's avatar Dan Carpenter Committed by Eric Anholt

drm/vc4: allocate enough memory in vc4_save_hang_state()

"state" is smaller than "kernel_state" so we end up corrupting memory.

Fixes: 21461365 ('drm/vc4: Add an interface for capturing the GPU state after a hang.')
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarEric Anholt <eric@anholt.net>
parent 65c4777d
......@@ -145,7 +145,7 @@ vc4_save_hang_state(struct drm_device *dev)
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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment