Re: [RESEND PATCH] drm/virtio: check return value of vgdev_output_init()

Dmitry Osipenko <[email protected]>
Newsgroups dev.linux.lists.virtualization,org.freedesktop.lists.dri-devel,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On 8/11/26 04:56, shechenglong wrote:
> 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 <[email protected]>
> ---
>  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
> 

Applied to drm-misc-fixes, thanks!

-- 
Best regards,
Dmitry
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.