From: sashiko-bot@kernel.org
To: "Dmitry Baryshkov" <dmitry.baryshkov@oss.qualcomm.com>
Cc: wsa+renesas@sang-engineering.com, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v6 9/9] drm: writeback: rename drm_writeback_connector_init_with_encoder()
Date: Fri, 12 Jun 2026 18:49:49 +0000 [thread overview]
Message-ID: <20260612184950.028551F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260612-wb-drop-encoder-v6-9-9f3a54f81310@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
New issues:
- [Low] The kernel-doc comment for `drm_writeback_connector_init` has mismatched parameter ordering compared to the newly adapted function signature.
Pre-existing issues:
- [Critical] Failure to initialize a subsequent writeback connector destroys global properties attached to already initialized writeback connectors, causing a Use-After-Free.
--
commit 04d131d999200c125f2670f5258a856880015f21
Author: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
drm: writeback: rename drm_writeback_connector_init_with_encoder()
Rename drm_writeback_connector_init_with_encoder() to
drm_writeback_connector_init() and adapt its interface to follow
drmm_writeback_connector_init().
> diff --git a/drivers/gpu/drm/drm_writeback.c b/drivers/gpu/drm/drm_writeback.c
> index 9fc15168c34f6..68fdac745f42f 100644
> --- a/drivers/gpu/drm/drm_writeback.c
> +++ b/drivers/gpu/drm/drm_writeback.c
> @@ -235,7 +235,7 @@ static int __drm_writeback_connector_init(struct drm_device *dev,
> }
[Severity: Critical]
This isn't a bug introduced by this patch, but does the error path in
__drm_writeback_connector_init() improperly destroy global properties?
When __drm_writeback_connector_init() fails, it jumps to the
failed_properties label:
failed_properties:
delete_writeback_properties(dev);
return ret;
Then delete_writeback_properties() destroys the properties attached to the
device:
if (dev->mode_config.writeback_pixel_formats_property) {
drm_property_destroy(dev, dev->mode_config.writeback_pixel_formats_property);
dev->mode_config.writeback_pixel_formats_property = NULL;
}
If a driver attempts to initialize a second writeback connector and it fails,
won't this unconditionally free the global property objects that are still
attached to the first successfully initialized connector, causing a
use-after-free when those dangling pointers are later accessed?
>
> /**
> - * drm_writeback_connector_init_with_encoder - Initialize a writeback connector with
> + * drm_writeback_connector_init - Initialize a writeback connector with
> * a custom encoder
[ ... ]
> @@ -263,11 +263,11 @@ static int __drm_writeback_connector_init(struct drm_device *dev,
> *
> * Returns: 0 on success, or a negative error code
> */
> -int drm_writeback_connector_init_with_encoder(struct drm_device *dev,
> - struct drm_writeback_connector *wb_connector,
> - struct drm_encoder *enc,
> - const struct drm_connector_funcs *con_funcs,
> - const u32 *formats, int n_formats)
> +int drm_writeback_connector_init(struct drm_device *dev,
> + struct drm_writeback_connector *wb_connector,
> + const struct drm_connector_funcs *con_funcs,
> + struct drm_encoder *enc,
> + const u32 *formats, int n_formats)
[Severity: Low]
Since the parameter order of con_funcs and enc has been swapped in the
signature, does the kernel-doc comment above this function need to be
updated?
The kernel-doc still lists @enc before @con_funcs, which creates a mismatch
between the documentation and the new function signature.
> {
> struct drm_connector *connector = &wb_connector->base;
> int ret;
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260612-wb-drop-encoder-v6-0-9f3a54f81310@oss.qualcomm.com?part=9
prev parent reply other threads:[~2026-06-12 18:49 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-12 18:30 [PATCH v6 0/9] drm: writeback: clean up writeback connector initialization Dmitry Baryshkov
2026-06-12 18:30 ` [PATCH v6 1/9] drm/managed: implement managed versions of kzalloc_obj/objs() Dmitry Baryshkov
2026-06-12 18:41 ` sashiko-bot
2026-06-12 18:30 ` [PATCH v6 2/9] drm/amd/display: use drmm allocation for writeback connector Dmitry Baryshkov
2026-06-12 18:44 ` sashiko-bot
2026-06-12 18:30 ` [PATCH v6 3/9] drm/amd/display: use drmm_writeback_connector_init() Dmitry Baryshkov
2026-06-12 18:58 ` sashiko-bot
2026-06-12 18:30 ` [PATCH v6 4/9] drm/komeda: " Dmitry Baryshkov
2026-06-12 18:39 ` sashiko-bot
2026-06-12 18:30 ` [PATCH v6 5/9] drm/mali: " Dmitry Baryshkov
2026-06-12 18:40 ` sashiko-bot
2026-06-12 18:30 ` [PATCH v6 6/9] drm: renesas: rcar-du: " Dmitry Baryshkov
2026-06-12 18:30 ` [PATCH v6 7/9] drm/vc4: " Dmitry Baryshkov
2026-06-12 18:44 ` sashiko-bot
2026-06-12 18:30 ` [PATCH v6 8/9] drm: writeback: drop excess connector initialization functions Dmitry Baryshkov
2026-06-12 18:30 ` [PATCH v6 9/9] drm: writeback: rename drm_writeback_connector_init_with_encoder() Dmitry Baryshkov
2026-06-12 18:49 ` 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=20260612184950.028551F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dmitry.baryshkov@oss.qualcomm.com \
--cc=dri-devel@lists.freedesktop.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.