From: sashiko-bot@kernel.org
To: "Minseo Park" <hiyoukou@gmail.com>, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2 1/4] drm/sti: cursor: do not resize the pixmap from .atomic_check()
Date: Thu, 26 Nov 2026 08:32:55 +0000 [thread overview]
Message-ID: <sashiko-outbox-235027@kernel.org> (raw)
In-Reply-To: <20261126024710.33401-2-hiyoukou@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] drm/sti: leak of managed pixmap DMA buffer on error in
sti_cursor_create()
--
commit e56d841601d0e4ed868b107dc1847844ca728b69
Author: Minseo Park <hiyoukou@gmail.com>
drm/sti: cursor: do not resize the pixmap from .atomic_check()
This commit allocates the cursor pixmap DMA buffer once at plane creation
time instead of reallocating it inside sti_cursor_atomic_check().
> diff --git a/drivers/gpu/drm/sti/sti_cursor.c b/drivers/gpu/drm/sti/sti_cursor.c
> index 66f56355309f9..7295b6edb8ef9 100644
> --- a/drivers/gpu/drm/sti/sti_cursor.c
> +++ b/drivers/gpu/drm/sti/sti_cursor.c
[ ... ]
> @@ -377,6 +353,22 @@ struct drm_plane *sti_cursor_create(struct drm_device *drm_dev,
> return NULL;
> }
>
> + /*
> + * Allocate the pixmap once, for the largest cursor the hardware
> + * supports. It used to be reallocated from .atomic_check(), which
> + * freed a buffer the display engine could still be scanning out.
> + * Use the managed helper so it is released with the device.
> + */
> + cursor->pixmap.size = STI_CURS_MAX_SIZE * STI_CURS_MAX_SIZE;
> + cursor->pixmap.base = dmam_alloc_attrs(dev, cursor->pixmap.size,
> + &cursor->pixmap.paddr,
> + GFP_KERNEL,
> + DMA_ATTR_WRITE_COMBINE);
> + if (!cursor->pixmap.base) {
> + drm_err(drm_dev, "Failed to allocate memory for pixmap\n");
> + goto err_clut;
> + }
> +
> /* Allocate clut buffer */
> size = 0x100 * sizeof(unsigned short);
> cursor->clut = dma_alloc_wc(dev, size, &cursor->clut_paddr,
> @@ -387,7 +379,6 @@ struct drm_plane *sti_cursor_create(struct drm_device *drm_dev,
> goto err_clut;
> }
>
> - cursor->dev = dev;
> cursor->regs = baseaddr;
> cursor->plane.desc = desc;
> cursor->plane.status = STI_PLANE_DISABLED;
[Severity: Medium]
Does sti_cursor_create() leak cursor->pixmap.base when allocating
cursor->clut or calling drm_universal_plane_init() fails?
The err_plane and err_clut paths free cursor->clut and cursor, without
releasing cursor->pixmap.base. Because sti_compositor_bind() treats a
NULL return from sti_cursor_create() as non-fatal and still returns 0,
devres on compo->dev is not released on failure and the 16 KiB DMA buffer
stays allocated while the compositor remains bound.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261126024710.33401-1-hiyoukou@gmail.com?part=1
next prev parent reply other threads:[~2026-11-26 8:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 2:47 [PATCH v2 0/4] drm/sti: move commit work out of .atomic_check() Minseo Park
2026-11-26 2:47 ` [PATCH v2 1/4] drm/sti: cursor: do not resize the pixmap from .atomic_check() Minseo Park
2026-11-26 8:32 ` sashiko-bot [this message]
2026-11-26 2:47 ` [PATCH v2 2/4] drm/sti: gdp: set the pixel clock from .atomic_update() Minseo Park
2026-11-26 8:35 ` sashiko-bot
2026-11-26 2:47 ` [PATCH v2 3/4] drm/sti: hqvdp: start the XP70 from device init Minseo Park
2026-11-26 8:34 ` sashiko-bot
2026-11-26 2:47 ` [PATCH v2 4/4] drm/sti: hqvdp: register the VTG client from .atomic_update() Minseo Park
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=sashiko-outbox-235027@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=hiyoukou@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 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.