From: sashiko-bot@kernel.org
To: "Maxime Ripard" <mripard@kernel.org>
Cc: dri-devel@lists.freedesktop.org, linux-sunxi@lists.linux.dev
Subject: Re: [PATCH RESEND 47/83] drm/sun4i: Switch to drm_mode_config_create_initial_state
Date: Thu, 05 Nov 2026 20:24:02 +0000 [thread overview]
Message-ID: <sashiko-outbox-200092@kernel.org> (raw)
In-Reply-To: <20261105-drm-no-more-config-reset-v1-47-1f58d1e33380@kernel.org>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] drm/sun4i: sun4i_framebuffer_init() ignores state creation failure
--
commit 9bfddf90d8dccabe2d26ebb9b512f7adbc95c198
Author: Maxime Ripard <mripard@kernel.org>
drm/sun4i: Switch to drm_mode_config_create_initial_state
This commit replaces the probe-time drm_mode_config_reset() call in
sun4i_framebuffer_init() with drm_mode_config_create_initial_state() to
create the initial KMS state.
> diff --git a/drivers/gpu/drm/sun4i/sun4i_framebuffer.c b/drivers/gpu/drm/sun4i/sun4i_framebuffer.c
> index fc822bc2c62b5..0ce3691dedade 100644
> --- a/drivers/gpu/drm/sun4i/sun4i_framebuffer.c
> +++ b/drivers/gpu/drm/sun4i/sun4i_framebuffer.c
> @@ -10,6 +10,7 @@
> #include <drm/drm_atomic_helper.h>
> #include <drm/drm_blend.h>
> #include <drm/drm_gem_framebuffer_helper.h>
> +#include <drm/drm_print.h>
>
> #include "sun4i_drv.h"
> #include "sun4i_framebuffer.h"
> @@ -26,7 +27,8 @@ static const struct drm_mode_config_helper_funcs sun4i_de_mode_config_helpers =
>
> void sun4i_framebuffer_init(struct drm_device *drm)
> {
> - drm_mode_config_reset(drm);
> + drm_WARN(drm, drm_mode_config_create_initial_state(drm),
> + "Failed to create state\n");
[Severity: High]
Should sun4i_framebuffer_init() return an int and propagate errors from
drm_mode_config_create_initial_state(drm) back to sun4i_drv_bind()?
When drm_mode_config_create_initial_state(drm) fails to allocate state for a
private object, colorop, plane, CRTC, or connector, it returns early with a
negative errno, leaving that object and all subsequent KMS objects with a
NULL state pointer.
Because sun4i_framebuffer_init() only warns and returns void, its caller
sun4i_drv_bind() in drivers/gpu/drm/sun4i/sun4i_drv.c continues execution:
sun4i_framebuffer_init(drm);
/* Enable connectors polling */
drm_kms_helper_poll_init(drm);
ret = drm_dev_register(drm, 0);
if (ret)
goto finish_poll;
drm_client_setup(drm, NULL);
When drm_client_setup(), a userspace atomic commit, or
drm_atomic_helper_shutdown() duplicates plane state via
sun4i_backend_layer_duplicate_state() in drivers/gpu/drm/sun4i/sun4i_layer.c,
plane->state is dereferenced without a NULL check:
struct sun4i_layer_state *orig = state_to_sun4i_layer_state(plane->state);
struct sun4i_layer_state *copy;
copy = kzalloc_obj(*copy);
if (!copy)
return NULL;
__drm_atomic_helper_plane_duplicate_state(plane, ©->state);
copy->uses_frontend = orig->uses_frontend;
Could this cause a NULL pointer dereference in
__drm_atomic_helper_plane_duplicate_state(), orig->uses_frontend, or during
userspace property queries via drm_atomic_get_property() if
sun4i_drv_bind() does not abort and jump to unbind_all on state creation
failure?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261105-drm-no-more-config-reset-v1-0-1f58d1e33380@kernel.org?part=47
next prev parent reply other threads:[~2026-11-05 20:24 UTC|newest]
Thread overview: 122+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-05 15:29 [PATCH RESEND 00/83] drm: Switch drivers to drm_mode_config_create_initial_state Maxime Ripard
2026-11-05 15:29 ` Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 01/83] drm/adp: Switch " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 02/83] drm/amdgpu: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 03/83] drm/appletbdrm: " Maxime Ripard
2026-11-05 17:41 ` Aditya Garg
2026-11-05 15:29 ` [PATCH RESEND 04/83] drm/komeda: " Maxime Ripard
2026-11-05 15:46 ` Liviu Dudau
2026-11-05 15:29 ` [PATCH RESEND 05/83] drm/hdlcd: " Maxime Ripard
2026-11-05 15:46 ` Liviu Dudau
2026-11-05 16:30 ` sashiko-bot
2026-11-05 15:29 ` [PATCH RESEND 06/83] drm/malidp: " Maxime Ripard
2026-11-05 15:46 ` Liviu Dudau
2026-11-05 15:29 ` [PATCH RESEND 07/83] drm/armada: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 08/83] drm/aspeed: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 09/83] drm/ast: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 10/83] drm/atmel-hlcdc: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 11/83] drm/exynos: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 12/83] drm/fsl-dcu: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 13/83] drm/gud: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 14/83] drm/hisilicon/hibmc: " Maxime Ripard
2026-11-05 17:25 ` sashiko-bot
2026-11-05 15:29 ` [PATCH RESEND 15/83] drm/hisilicon/kirin: " Maxime Ripard
2026-11-05 19:35 ` John Stultz
2026-11-05 15:29 ` [PATCH RESEND 16/83] drm/hyperv: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 17/83] drm/imx/dc: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 18/83] drm/imx/dcss: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 19/83] drm/imx/ipuv3: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 20/83] drm/ingenic: " Maxime Ripard
2026-11-05 15:56 ` Paul Cercueil
2026-11-05 18:12 ` sashiko-bot
2026-11-05 15:29 ` [PATCH RESEND 21/83] drm/kmb: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 22/83] drm/logicvc: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 23/83] drm/loongson: " Maxime Ripard
2026-11-05 18:28 ` sashiko-bot
2026-11-05 15:29 ` [PATCH RESEND 24/83] drm/mcde: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 25/83] drm/mediatek: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 26/83] drm/meson: " Maxime Ripard
2026-11-05 15:29 ` Maxime Ripard
2026-11-05 15:52 ` neil.armstrong
2026-11-05 15:52 ` neil.armstrong
2026-11-05 15:29 ` [PATCH RESEND 27/83] drm/mgag200: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 28/83] drm/msm: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 29/83] drm/lcdif: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 30/83] drm/mxsfb: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 31/83] drm/nouveau: " Maxime Ripard
2026-11-05 15:29 ` Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 32/83] drm/omap: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 33/83] drm/pl111: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 34/83] drm/qxl: " Maxime Ripard
2026-11-05 19:32 ` sashiko-bot
2026-11-05 15:29 ` [PATCH RESEND 35/83] drm/rcar-du: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 36/83] drm/rz-du: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 37/83] drm/shmobile: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 38/83] drm/rockchip: " Maxime Ripard
2026-11-05 15:29 ` Maxime Ripard
2026-11-05 19:05 ` Heiko Stübner
2026-11-05 19:05 ` Heiko Stübner
2026-11-05 15:29 ` [PATCH RESEND 39/83] drm/st7571: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 40/83] drm/st7586: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 41/83] drm/st7735r: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 42/83] drm/st7920: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 43/83] drm/ssd130x: " Maxime Ripard
2026-11-05 15:53 ` Javier Martinez Canillas
2026-11-05 15:29 ` [PATCH RESEND 44/83] drm/sprd: " Maxime Ripard
2026-11-05 15:29 ` [PATCH RESEND 45/83] drm/sti: " Maxime Ripard
2026-11-05 20:07 ` sashiko-bot
2026-11-05 15:29 ` [PATCH RESEND 46/83] drm/stm: " Maxime Ripard
2026-11-05 20:15 ` sashiko-bot
2026-11-05 15:29 ` [PATCH RESEND 47/83] drm/sun4i: " Maxime Ripard
2026-11-05 15:37 ` Chen-Yu Tsai
2026-11-05 20:24 ` sashiko-bot [this message]
2026-11-05 15:29 ` [PATCH RESEND 48/83] drm/corebootdrm: " Maxime Ripard
2026-11-05 15:54 ` Javier Martinez Canillas
2026-11-05 15:29 ` [PATCH RESEND 49/83] drm/efidrm: " Maxime Ripard
2026-11-05 15:55 ` Javier Martinez Canillas
2026-11-05 15:29 ` [PATCH RESEND 50/83] drm/ofdrm: " Maxime Ripard
2026-11-05 15:56 ` Javier Martinez Canillas
2026-11-05 15:30 ` [PATCH RESEND 51/83] drm/simpledrm: " Maxime Ripard
2026-11-05 15:56 ` Javier Martinez Canillas
2026-11-05 15:30 ` [PATCH RESEND 52/83] drm/vesadrm: " Maxime Ripard
2026-11-05 15:57 ` Javier Martinez Canillas
2026-11-05 15:30 ` [PATCH RESEND 53/83] drm/tegra: " Maxime Ripard
2026-11-05 15:51 ` Thierry Reding
2026-11-05 15:30 ` [PATCH RESEND 54/83] drm/tests: drm_atomic_state_test: " Maxime Ripard
2026-11-05 20:46 ` sashiko-bot
2026-11-05 15:30 ` [PATCH RESEND 55/83] drm/tests: drm_atomic_test: " Maxime Ripard
2026-11-05 15:30 ` [PATCH RESEND 56/83] drm/tests: drm_bridge_test: " Maxime Ripard
2026-11-05 15:30 ` [PATCH RESEND 57/83] drm/tests: drm_hdmi_state_helper_test: " Maxime Ripard
2026-11-05 21:01 ` sashiko-bot
2026-11-05 15:30 ` [PATCH RESEND 58/83] drm/tidss: " Maxime Ripard
2026-11-05 15:30 ` [PATCH RESEND 59/83] drm/tilcdc: " Maxime Ripard
2026-11-05 21:19 ` sashiko-bot
2026-11-05 15:30 ` [PATCH RESEND 60/83] drm/arcpgu: " Maxime Ripard
2026-11-05 15:30 ` [PATCH RESEND 61/83] drm/bochs: " Maxime Ripard
2026-11-05 21:25 ` sashiko-bot
2026-11-05 15:30 ` [PATCH RESEND 62/83] drm/cirrus-qemu: " Maxime Ripard
2026-11-05 21:26 ` sashiko-bot
2026-11-05 15:30 ` [PATCH RESEND 63/83] drm/gm12u320: " Maxime Ripard
2026-11-05 15:30 ` [PATCH RESEND 64/83] drm/hx8357d: " Maxime Ripard
2026-11-05 15:30 ` [PATCH RESEND 65/83] drm/ili9163: " Maxime Ripard
2026-11-05 15:30 ` [PATCH RESEND 66/83] drm/ili9225: " Maxime Ripard
2026-11-05 15:30 ` [PATCH RESEND 67/83] drm/ili9341: " Maxime Ripard
2026-11-05 15:30 ` [PATCH RESEND 68/83] drm/ili9486: " Maxime Ripard
2026-11-05 15:30 ` [PATCH RESEND 69/83] drm/mi0283qt: " Maxime Ripard
2026-11-05 15:30 ` [PATCH RESEND 70/83] drm/panel-mipi-dbi: " Maxime Ripard
2026-11-05 15:30 ` [PATCH RESEND 71/83] drm/pixpaper: " Maxime Ripard
2026-11-05 15:30 ` [PATCH RESEND 72/83] drm/repaper: " Maxime Ripard
2026-11-05 15:30 ` [PATCH RESEND 73/83] drm/sharp-memory: " Maxime Ripard
2026-11-05 15:30 ` [PATCH RESEND 74/83] drm/tve200: " Maxime Ripard
2026-11-05 15:30 ` [PATCH RESEND 75/83] drm/udl: " Maxime Ripard
2026-11-05 15:30 ` [PATCH RESEND 76/83] drm/vboxvideo: " Maxime Ripard
2026-11-05 15:30 ` [PATCH RESEND 77/83] drm/vc4: " Maxime Ripard
2026-11-05 16:06 ` Dave Stevenson
2026-11-05 15:30 ` [PATCH RESEND 78/83] drm/verisilicon: " Maxime Ripard
2026-11-05 15:30 ` [PATCH RESEND 79/83] drm/virtio: " Maxime Ripard
2026-11-05 22:14 ` sashiko-bot
2026-11-05 15:30 ` [PATCH RESEND 80/83] drm/vkms: " Maxime Ripard
2026-11-05 15:30 ` [PATCH RESEND 81/83] drm/vmwgfx: " Maxime Ripard
2026-11-05 22:27 ` sashiko-bot
2026-11-05 15:30 ` [PATCH RESEND 82/83] drm/xen: " Maxime Ripard
2026-11-05 15:30 ` [PATCH RESEND 83/83] drm/xlnx: " Maxime Ripard
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-200092@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-sunxi@lists.linux.dev \
--cc=mripard@kernel.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 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.