From: luyuantao <[email protected]>

When kmsg_buf completes drawing the screen and yoffset is less than 0,
kmsg_dump_get_buffer continues to obtain the buffer. This potential loop may
cause panic_flush not to be executed immediately or even not to be executed
at all, resulting in a garbled screen display instead of normal logs

So, the loop should be exited immediately after drawing kmsg_buf

Signed-off-by: luyuantao <[email protected]>
---
 drivers/gpu/drm/drm_panic.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/drm_panic.c b/drivers/gpu/drm/drm_panic.c
index d4b6ea42db0f..4b44011b4be1 100644
--- a/drivers/gpu/drm/drm_panic.c
+++ b/drivers/gpu/drm/drm_panic.c
@@ -592,6 +592,9 @@ static void draw_panic_static_kmsg(struct 
drm_scanout_buffer *sb)
                        end = start;
                        start--;
                }
+
+               if (yoffset < 0)
+                       break;
        }
 }
 
-- 
2.27.0

Reply via email to