mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-25 20:14:25 +08:00
drm/vc4: allocate enough memory in vc4_save_hang_state()
"state" is smaller than "kernel_state" so we end up corrupting memory.
Fixes: 214613656b
('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>
This commit is contained in:
parent
65c4777de5
commit
7e5082fbc0
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user