From: sashiko-bot@kernel.org
To: "Igor Reznichenko" <igor@reznichenko.net>
Cc: conor+dt@kernel.org, devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH v5 2/2] drm/panel: Add Ilitek ILI9488 controller driver
Date: Fri, 29 May 2026 06:59:09 +0000 [thread overview]
Message-ID: <20260529065909.A01291F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260529062836.203990-3-igor@reznichenko.net>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] Missing NULL pointer check for the return value of device_get_match_data() leads to a kernel panic.
- [Low] The driver calls devm_drm_panel_add(), which is a non-existent function in the DRM subsystem, causing a compilation failure.
--
commit 279cca9ce157e0fd7f3b036067b2491d2e280fa4
Author: Igor Reznichenko <igor@reznichenko.net>
drm/panel: Add Ilitek ILI9488 controller driver
This commit adds support for the Ilitek ILI9488 DSI controller used in the
FocusLCDs E35GH-I-MW800-CB 320x480 MIPI DSI panel.
> diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9488.c b/drivers/gpu/drm/panel/panel-ilitek-ili9488.c
> new file mode 100644
> index 0000000000000..7302766034fc9
> --- /dev/null
> +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9488.c
[ ... ]
> +static int ili9488_dsi_probe(struct mipi_dsi_device *dsi)
> +{
> + struct device *dev = &dsi->dev;
> + struct ili9488 *ili;
> + int i, ret;
> +
> + ili = devm_drm_panel_alloc(dev, struct ili9488, panel, &ili9488_funcs,
> + DRM_MODE_CONNECTOR_DSI);
> + if (IS_ERR(ili))
> + return PTR_ERR(ili);
> +
> + ili->desc = device_get_match_data(dev);
> + ili->dsi = dsi;
> +
> + dsi->mode_flags = ili->desc->mode_flags;
[Severity: High]
Is it possible for device_get_match_data() to return NULL here?
If the device is instantiated without matching device tree data (for example,
via a manual sysfs driver bind to a DSI device created without an OF node),
device_get_match_data() will return NULL because the driver lacks an id_table
and only provides an of_match_table.
Dereferencing ili->desc immediately after might lead to a NULL pointer
dereference in these cases.
[ ... ]
> + ret = drm_panel_of_backlight(&ili->panel);
> + if (ret)
> + return dev_err_probe(dev, ret, "failed to get backlight\n");
> +
> + ili->panel.prepare_prev_first = true;
> +
> + ret = devm_drm_panel_add(dev, &ili->panel);
[Severity: Low]
Does devm_drm_panel_add() exist in the DRM subsystem?
Looking at the DRM panel API, while there is devm_drm_panel_alloc() and
drm_panel_add(), there does not appear to be a devm-managed version of
drm_panel_add(). Will this cause a build failure when compiling the driver?
> + if (ret)
> + return ret;
> +
> + ret = devm_mipi_dsi_attach(dev, dsi);
> + if (ret < 0)
> + return dev_err_probe(dev, ret, "failed to attach to DSI host\n");
> +
> + return 0;
> +}
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260529062836.203990-1-igor@reznichenko.net?part=2
prev parent reply other threads:[~2026-05-29 6:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-29 6:28 [PATCH v5 0/2] drm/panel: Add support for the FocusLCDs E35GH-I-MW800CB Igor Reznichenko
2026-05-29 6:28 ` [PATCH v5 1/2] dt-bindings: display: panel: Add Ilitek ILI9488 panel controller Igor Reznichenko
2026-05-29 6:35 ` sashiko-bot
2026-05-29 6:28 ` [PATCH v5 2/2] drm/panel: Add Ilitek ILI9488 controller driver Igor Reznichenko
2026-05-29 6:59 ` 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=20260529065909.A01291F00893@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=igor@reznichenko.net \
--cc=robh@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox