Commit a63ee078 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Jocelyn Falempe
Browse files

drm/panic: Fix uninitialized drm_scanout_buffer.set_pixel() crash



No implementations of drm_plane_helper_funcs.get_scanout_buffer() fill
in the optional drm_scanout_buffer.set_pixel() member.  Hence the member
may contain non-zero garbage, causing a crash when deferencing it during
drm panic.

Fix this by pre-initializing the drm_scanout_buffer object before
calling drm_plane_helper_funcs.get_scanout_buffer().

Fixes: 24d07f11 ("drm/panic: Add a set_pixel() callback to drm_scanout_buffer")
Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: default avatarJocelyn Falempe <jfalempe@redhat.com>
Signed-off-by: default avatarJocelyn Falempe <jfalempe@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/4c250d21880ca0b97e41da7b6a101bdf07e9d015.1718305355.git.geert+renesas@glider.be
parent 07430fa5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -582,7 +582,7 @@ static void draw_panic_dispatch(struct drm_scanout_buffer *sb)

static void draw_panic_plane(struct drm_plane *plane)
{
	struct drm_scanout_buffer sb;
	struct drm_scanout_buffer sb = { };
	int ret;
	unsigned long flags;