From: shechenglong <shechenglong@xfusion.com>
To: <airlied@redhat.com>, <kraxel@redhat.com>,
<dmitry.osipenko@collabora.com>, <gurchetansingh@chromium.org>,
<olvaffe@gmail.com>, <maarten.lankhorst@linux.intel.com>
Cc: <mripard@kernel.org>, <tzimmermann@suse.de>, <simona@ffwll.ch>,
<dri-devel@lists.freedesktop.org>,
<virtualization@lists.linux.dev>, <linux-kernel@vger.kernel.org>,
<stone.xulei@xfusion.com>, <chenjialong@xfusion.com>,
shechenglong <shechenglong@xfusion.com>
Subject: [RESEND PATCH] drm/virtio: check return value of vgdev_output_init()
Date: Tue, 11 Aug 2026 09:56:24 +0800 [thread overview]
Message-ID: <20260811015624.830-1-shechenglong@xfusion.com> (raw)
In-Reply-To: <20260802101108.1595-1-shechenglong@xfusion.com>
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
next prev parent reply other threads:[~2026-08-11 1:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-02 10:11 [PATCH] drm/virtio: check return value of vgdev_output_init() shechenglong
2026-08-11 1:56 ` shechenglong [this message]
2026-08-11 15:33 ` [RESEND PATCH] " Dmitry Osipenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260811015624.830-1-shechenglong@xfusion.com \
--to=shechenglong@xfusion.com \
--cc=airlied@redhat.com \
--cc=chenjialong@xfusion.com \
--cc=dmitry.osipenko@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=gurchetansingh@chromium.org \
--cc=kraxel@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=olvaffe@gmail.com \
--cc=simona@ffwll.ch \
--cc=stone.xulei@xfusion.com \
--cc=tzimmermann@suse.de \
--cc=virtualization@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox