Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;