All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Diogo Silva" <diogompaissilva@gmail.com>
Cc: imx@lists.linux.dev, neil.armstrong@linaro.org,
	wsa+renesas@sang-engineering.com,
	linux-amlogic@lists.infradead.org, Frank.Li@kernel.org,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2 06/15] drm/virtio: remove dependency on DRM simple helpers
Date: Mon, 20 Jul 2026 16:00:21 +0000	[thread overview]
Message-ID: <20260720160021.8D2561F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260720-drm_simple_encoder_init-v2-6-5020b630668a@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] Unhandled return value of drm_connector_init() leading to potential kernel oops on allocation failure.
--

--- Patch [6]: [PATCH v2 06/15] drm/virtio: remove dependency on DRM simple helpers ---
commit c3e48910730cab2ede63c55569b1ea2f386b9c60
Author: Diogo Silva <diogompaissilva@gmail.com>

drm/virtio: remove dependency on DRM simple helpers

This commit removes the deprecated DRM simple KMS helper dependency
by open-coding drm_simple_encoder_init() into drm_encoder_init()
and correctly checking the return value to prevent silent failures.

> diff --git a/drivers/gpu/drm/virtio/virtgpu_display.c b/drivers/gpu/drm/virtio/virtgpu_display.c
> --- a/drivers/gpu/drm/virtio/virtgpu_display.c
> +++ b/drivers/gpu/drm/virtio/virtgpu_display.c

[ ... ]

> @@ -306,7 +310,11 @@ static int vgdev_output_init(struct virtio_gpu_device *vgdev, int index)
>  	if (vgdev->has_edid)
>  		drm_connector_attach_edid_property(connector);

[Severity: High]
This is a pre-existing issue, but looking at the context just
above these lines in vgdev_output_init(), the return value of
drm_connector_init() is ignored.

Since this patch corrects missing error handling for drm_encoder_init(),
would it make sense to also catch errors from drm_connector_init() in this
same function?

If drm_connector_init() fails (such as from resource exhaustion), the
connector structure is left uninitialized. Calling drm_connector_helper_add()
and drm_connector_attach_edid_property() subsequently will dereference this
uninitialized state, which can lead to a crash.

> -	drm_simple_encoder_init(dev, encoder, DRM_MODE_ENCODER_VIRTUAL);
> +	ret = drm_encoder_init(dev, encoder, &virtio_gpu_enc_funcs,
> +			       DRM_MODE_ENCODER_VIRTUAL, NULL);
> +	if (ret)
> +		return ret;
> +
>  	drm_encoder_helper_add(encoder, &virtio_gpu_enc_helper_funcs);

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260720-drm_simple_encoder_init-v2-0-5020b630668a@gmail.com?part=6

WARNING: multiple messages have this Message-ID (diff)
From: sashiko-bot@kernel.org
To: "Diogo Silva" <diogompaissilva@gmail.com>
Cc: imx@lists.linux.dev, neil.armstrong@linaro.org,
	wsa+renesas@sang-engineering.com,
	linux-amlogic@lists.infradead.org, Frank.Li@kernel.org,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2 06/15] drm/virtio: remove dependency on DRM simple helpers
Date: Mon, 20 Jul 2026 16:00:21 +0000	[thread overview]
Message-ID: <20260720160021.8D2561F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260720-drm_simple_encoder_init-v2-6-5020b630668a@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] Unhandled return value of drm_connector_init() leading to potential kernel oops on allocation failure.
--

--- Patch [6]: [PATCH v2 06/15] drm/virtio: remove dependency on DRM simple helpers ---
commit c3e48910730cab2ede63c55569b1ea2f386b9c60
Author: Diogo Silva <diogompaissilva@gmail.com>

drm/virtio: remove dependency on DRM simple helpers

This commit removes the deprecated DRM simple KMS helper dependency
by open-coding drm_simple_encoder_init() into drm_encoder_init()
and correctly checking the return value to prevent silent failures.

> diff --git a/drivers/gpu/drm/virtio/virtgpu_display.c b/drivers/gpu/drm/virtio/virtgpu_display.c
> --- a/drivers/gpu/drm/virtio/virtgpu_display.c
> +++ b/drivers/gpu/drm/virtio/virtgpu_display.c

[ ... ]

> @@ -306,7 +310,11 @@ static int vgdev_output_init(struct virtio_gpu_device *vgdev, int index)
>  	if (vgdev->has_edid)
>  		drm_connector_attach_edid_property(connector);

[Severity: High]
This is a pre-existing issue, but looking at the context just
above these lines in vgdev_output_init(), the return value of
drm_connector_init() is ignored.

Since this patch corrects missing error handling for drm_encoder_init(),
would it make sense to also catch errors from drm_connector_init() in this
same function?

If drm_connector_init() fails (such as from resource exhaustion), the
connector structure is left uninitialized. Calling drm_connector_helper_add()
and drm_connector_attach_edid_property() subsequently will dereference this
uninitialized state, which can lead to a crash.

> -	drm_simple_encoder_init(dev, encoder, DRM_MODE_ENCODER_VIRTUAL);
> +	ret = drm_encoder_init(dev, encoder, &virtio_gpu_enc_funcs,
> +			       DRM_MODE_ENCODER_VIRTUAL, NULL);
> +	if (ret)
> +		return ret;
> +
>  	drm_encoder_helper_add(encoder, &virtio_gpu_enc_helper_funcs);

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260720-drm_simple_encoder_init-v2-0-5020b630668a@gmail.com?part=6

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

  reply	other threads:[~2026-07-20 16:00 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-20 15:40 [PATCH v2 00/15] drm/drm_simple: remove drm_simple_encoder_init Diogo Silva
2026-07-20 15:40 ` Diogo Silva
2026-07-20 15:40 ` [PATCH v2 01/15] drm/exynos: remove dependency on DRM simple helpers Diogo Silva
2026-07-20 15:40   ` Diogo Silva
2026-07-20 15:52   ` sashiko-bot
2026-07-20 15:52     ` sashiko-bot
2026-07-20 15:40 ` [PATCH v2 02/15] drm/xlnx/zynqmp_dpsub: " Diogo Silva
2026-07-20 15:40   ` Diogo Silva
2026-07-20 17:49   ` Pandey, Radhey Shyam
2026-07-20 17:49     ` Pandey, Radhey Shyam
2026-07-20 15:40 ` [PATCH v2 03/15] drm/tegra: " Diogo Silva
2026-07-20 15:40   ` Diogo Silva
2026-07-20 15:40 ` [PATCH v2 04/15] drm/fsl-dcu: " Diogo Silva
2026-07-20 15:40   ` Diogo Silva
2026-07-20 15:40 ` [PATCH v2 05/15] drm/kmb: " Diogo Silva
2026-07-20 15:40   ` Diogo Silva
2026-07-20 15:40 ` [PATCH v2 06/15] drm/virtio: " Diogo Silva
2026-07-20 15:40   ` Diogo Silva
2026-07-20 16:00   ` sashiko-bot [this message]
2026-07-20 16:00     ` sashiko-bot
2026-07-20 15:40 ` [PATCH v2 07/15] drm/tidss: " Diogo Silva
2026-07-20 15:40   ` Diogo Silva
2026-07-20 16:08   ` sashiko-bot
2026-07-20 16:08     ` sashiko-bot
2026-07-20 15:40 ` [PATCH v2 08/15] drm/imx: " Diogo Silva
2026-07-20 15:40   ` Diogo Silva
2026-07-20 15:40 ` [PATCH v2 09/15] drm/mediatek: " Diogo Silva
2026-07-20 15:40   ` Diogo Silva
2026-07-20 15:40 ` [PATCH v2 10/15] drm/renesas/shmobile: " Diogo Silva
2026-07-20 15:40   ` Diogo Silva
2026-07-20 15:40 ` [PATCH v2 11/15] drm/hisilicon/kirin: " Diogo Silva
2026-07-20 15:40   ` Diogo Silva
2026-07-20 15:50   ` sashiko-bot
2026-07-20 15:50     ` sashiko-bot
2026-07-20 15:40 ` [PATCH v2 12/15] drm/arm/komeda: " Diogo Silva
2026-07-20 15:40   ` Diogo Silva
2026-07-20 15:40 ` [PATCH v2 13/15] drm/meson: " Diogo Silva
2026-07-20 15:40   ` Diogo Silva
2026-07-20 15:56   ` sashiko-bot
2026-07-20 15:56     ` sashiko-bot
2026-07-20 15:40 ` [PATCH v2 14/15] drm/drm_simple: remove deprecated drm_simple_encoder_init function Diogo Silva
2026-07-20 15:40   ` Diogo Silva
2026-07-20 15:54   ` sashiko-bot
2026-07-20 15:54     ` sashiko-bot
2026-07-20 15:40 ` [PATCH v2 15/15] Documentation/gpu: remove completed drm_simple_encoder_init() todo Diogo Silva
2026-07-20 15:40   ` Diogo Silva
2026-07-20 16:07   ` sashiko-bot
2026-07-20 16:07     ` sashiko-bot

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=20260720160021.8D2561F00A3A@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Frank.Li@kernel.org \
    --cc=diogompaissilva@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=imx@lists.linux.dev \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=neil.armstrong@linaro.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=wsa+renesas@sang-engineering.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.