Linux virtualization list
 help / color / mirror / Atom feed
* [PATCH] drm/virtio: check return value of vgdev_output_init()
@ 2026-08-02 10:11 shechenglong
  2026-08-11  1:56 ` [RESEND PATCH] " shechenglong
  0 siblings, 1 reply; 3+ messages in thread
From: shechenglong @ 2026-08-02 10:11 UTC (permalink / raw)
  To: airlied, kraxel, dmitry.osipenko
  Cc: gurchetansingh, olvaffe, maarten.lankhorst, mripard, tzimmermann,
	simona, dri-devel, virtualization, linux-kernel, stone.xulei,
	chenjialong, shechenglong

The return value of vgdev_output_init(), called by
virtio_gpu_modeset_init(), is not checked. As a result, modeset
initialization continues even if an output fails to initialize.

check the return value and return the error to the caller.

Signed-off-by: shechenglong <shechenglong@xfusion.com>
---
 drivers/gpu/drm/virtio/virtgpu_display.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/virtio/virtgpu_display.c b/drivers/gpu/drm/virtio/virtgpu_display.c
index 44ffffec550f..f2b98d018c1e 100644
--- a/drivers/gpu/drm/virtio/virtgpu_display.c
+++ b/drivers/gpu/drm/virtio/virtgpu_display.c
@@ -378,8 +378,11 @@ int virtio_gpu_modeset_init(struct virtio_gpu_device *vgdev)

    vgdev->ddev->mode_config.fb_modifiers_not_supported = true;

-   for (i = 0 ; i < vgdev->num_scanouts; ++i)
-       vgdev_output_init(vgdev, i);
+   for (i = 0; i < vgdev->num_scanouts; ++i) {
+       ret = vgdev_output_init(vgdev, i);
+       if (ret)
+           return ret;
+   }

    ret = drm_vblank_init(vgdev->ddev, vgdev->num_scanouts);
    if (ret)
--
2.33.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-08-11 15:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-02 10:11 [PATCH] drm/virtio: check return value of vgdev_output_init() shechenglong
2026-08-11  1:56 ` [RESEND PATCH] " shechenglong
2026-08-11 15:33   ` Dmitry Osipenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox