提交 7e5082fb 编写于 作者: D Dan Carpenter 提交者: 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: NDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: NEric Anholt <eric@anholt.net>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册