From: sashiko-bot@kernel.org
To: "Davide Bonatto" <bonatto.davide@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v4] drm/tiny: arcpgu: Replace simple display pipe with regular atomic helpers
Date: Wed, 09 Sep 2026 12:50:11 +0000 [thread overview]
Message-ID: <20260909125011.D37BC1F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260909124108.168371-1-bonatto.davide@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] NULL pointer dereference in `arc_pgu_crtc_atomic_check` due to improper plane state retrieval API.
--
commit 80a9a4e01830c51d120962eff87086ac506b2424
Author: Davide Bonatto <bonatto.davide@gmail.com>
drm/tiny: arcpgu: Replace simple display pipe with regular atomic helpers
This commit migrates the arcpgu driver from the deprecated simple display pipe
helpers to explicitly managing individual plane, CRTC, and encoder objects
using standard atomic helpers.
> diff --git a/drivers/gpu/drm/tiny/arcpgu.c b/drivers/gpu/drm/tiny/arcpgu.c
> index c93d61ac0bb75..adda406927332 100644
> --- a/drivers/gpu/drm/tiny/arcpgu.c
> +++ b/drivers/gpu/drm/tiny/arcpgu.c
[ ... ]
> @@ -189,54 +203,133 @@ static void arc_pgu_mode_set(struct arcpgu_drm_private *arcpgu)
[ ... ]
> +static int arc_pgu_crtc_atomic_check(struct drm_crtc *crtc,
> + struct drm_atomic_commit *state)
> +{
> + struct drm_crtc_state *crct_state = drm_atomic_get_new_crtc_state(state, crtc);
> + struct arcpgu_drm_private *arcpgu = crtc_to_arcpgu_priv(crtc);
> + struct drm_plane_state *plane_state;
> +
> + if (!crct_state->enable)
> + return 0;
> +
> + plane_state = drm_atomic_get_new_plane_state(state, &arcpgu->plane);
> + if (IS_ERR(plane_state))
> + return PTR_ERR(plane_state);
> +
[Severity: High]
Can this result in a NULL pointer dereference during partial atomic commits?
When an atomic commit updates a CRTC property but does not modify the plane
and does not trigger a modeset, the plane might not be added to the atomic
state. In that case, drm_atomic_get_new_plane_state() returns NULL, not an
ERR_PTR.
Because IS_ERR(NULL) evaluates to false, the error check is bypassed, and
evaluating !plane_state->fb will dereference the NULL pointer. Should this
use drm_atomic_get_plane_state() instead, which safely attaches the plane to
the commit and returns an ERR_PTR on failure, or alternatively check for
NULL before dereferencing?
> + if (!plane_state->fb)
> + return -EINVAL;
> +
> + return 0;
> +}
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260909124108.168371-1-bonatto.davide@gmail.com?part=1
next prev parent reply other threads:[~2026-09-09 12:50 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-09 9:24 [PATCH] drm/tiny: arcpgu: Replace simple display pipe with regular atomic helpers Davide Bonatto
2026-09-09 9:38 ` sashiko-bot
2026-09-09 10:43 ` [PATCH v3] " Davide Bonatto
2026-09-09 11:03 ` sashiko-bot
2026-09-09 12:41 ` [PATCH v4] " Davide Bonatto
2026-09-09 12:50 ` sashiko-bot [this message]
2026-09-09 12:58 ` [PATCH v5] " Davide Bonatto
2026-09-09 13:22 ` sashiko-bot
2026-09-10 6:18 ` Thomas Zimmermann
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=20260909125011.D37BC1F00A3A@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bonatto.davide@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--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