dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: junsungpark774@gmail.com
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drivers: drm: remove drm_simple_encoder_init then inline with drm_encoder_init
Date: Thu, 30 Jul 2026 12:34:09 +0000	[thread overview]
Message-ID: <20260730123409.A58451F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260730084908.109270-1-junsungpark774@gmail.com>

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

Pre-existing issues:
- [High] The return value of drm_connector_init() is ignored, leading to potential use of a partially initialized connector object on failure.
--

--- Patch [1]: [PATCH] drivers: drm: remove drm_simple_encoder_init then inline with drm_encoder_init ---
commit fb41dbd1014b2770b1e9b17f944e26382c1aa83c
Author: Park Junsung <junsungpark774@gmail.com>

drivers: drm: remove drm_simple_encoder_init then inline with drm_encoder_init

This commit removes the unnecessary intermediate layer drm_simple_encoder_init
and inlines it directly into drm_encoder_init. It also introduces a static
drm_encoder_funcs struct to handle encoder cleanup.

> diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c
> index a026bd35ef485..52d9bb46ea959 100644
> --- a/drivers/gpu/drm/qxl/qxl_display.c
> +++ b/drivers/gpu/drm/qxl/qxl_display.c
[ ... ]
> @@ -1169,10 +1173,11 @@ static int qdev_output_init(struct drm_device *dev, int num_output)
>  	drm_connector_init(dev, &qxl_output->base,
>  			   &qxl_connector_funcs, DRM_MODE_CONNECTOR_VIRTUAL);
>  

[Severity: High]
This is a pre-existing issue, but is it safe to ignore the return value of
drm_connector_init() here in qdev_output_init()? 

If drm_connector_init() fails, for example due to an IDA allocation failure
under memory pressure, and the subsequent call to drm_encoder_init() succeeds,
could this result in using a partially initialized connector object? It seems
this might lead to undefined behavior or a kernel panic when the connector is
later accessed by the DRM core.

> -	ret = drm_simple_encoder_init(dev, &qxl_output->enc,
> -				      DRM_MODE_ENCODER_VIRTUAL);
> +	ret = drm_encoder_init(dev, &qxl_output->enc,
> +			       &drm_encoder_funcs_cleanup,
> +			       DRM_MODE_ENCODER_VIRTUAL, NULL);
>  	if (ret) {
> -		drm_err(dev, "drm_simple_encoder_init() failed, error %d\n",
> +		drm_err(dev, "drm_encoder_init() failed, error %d\n",
>  			ret);
>  		goto err_drm_connector_cleanup;
>  	}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260730084908.109270-1-junsungpark774@gmail.com?part=1

      reply	other threads:[~2026-07-30 12:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-30  8:49 [PATCH] drivers: drm: remove drm_simple_encoder_init then inline with drm_encoder_init junsungpark774
2026-07-30 12:34 ` sashiko-bot [this message]

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=20260730123409.A58451F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=junsungpark774@gmail.com \
    --cc=sashiko-reviews@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