Devicetree
 help / color / mirror / Atom feed
From: Nickolay Goppen <setotau@mainlining.org>
To: sashiko-reviews@lists.linux.dev
Cc: robh@kernel.org, dri-devel@lists.freedesktop.org,
	conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v2 2/3] drivers: gpu: drm: panel: Add BOE NT51021 driver
Date: Fri, 11 Sep 2026 18:48:33 +0300	[thread overview]
Message-ID: <d7e15309-8069-45ec-92a6-24ea113a537a@mainlining.org> (raw)
In-Reply-To: <20260911154433.BD65B1F00893@smtp.kernel.org>


11.09.2026 18:44, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [High] Ignored return values from `devm_drm_panel_add()` and `devm_mipi_dsi_attach()` leading to silent probe failures.
> --
>
> commit d977b7bfeacd8104619cc818002d70a48f32aad3
> Author: Nickolay Goppen <setotau@mainlining.org>
>
>      drivers: gpu: drm: panel: Add BOE NT51021 driver
>      
>      Add driver for BOE NT51021-based 8-inch and 10-inch DSI video mode
>      panels used in Xiaomi Mi Pad 4 and Mi Pad 4 Plus (xiaomi-clover)
>      tablets.
>
>> diff --git a/drivers/gpu/drm/panel/panel-novatek-nt51021.c b/drivers/gpu/drm/panel/panel-novatek-nt51021.c
>> new file mode 100644
>> index 0000000000000..61dd283769a75
>> --- /dev/null
>> +++ b/drivers/gpu/drm/panel/panel-novatek-nt51021.c
> [ ... ]
>
>> +static int nt51021_novatek_probe(struct mipi_dsi_device *dsi)
>> +{
>> +	struct device *dev = &dsi->dev;
>> +	struct novatek_nt51021_desc *ctx;
>> +	int ret;
> [ ... ]
>
>> +	ret = drm_panel_of_backlight(&ctx->panel);
>> +	if (ret)
>> +		return dev_err_probe(dev, ret, "Failed to get backlight\n");
>> +
>> +	devm_drm_panel_add(dev, &ctx->panel);
>> +
>> +	ret = devm_mipi_dsi_attach(dev, dsi);
>> +
>> +	return 0;
>> +}
> [Severity: High]
> Does this code silently ignore initialization failures?
>
> In nt51021_novatek_probe(), the return value of devm_drm_panel_add() is
> discarded. Additionally, the return value of devm_mipi_dsi_attach() is saved
> to the ret variable, but then the function unconditionally returns 0.
>
> If either devm_drm_panel_add() or devm_mipi_dsi_attach() fails, the probe
> function will incorrectly report success. Should the code check these return
> values and propagate any errors?
Didn't notice that, thanks

-- 
Best regards,
Nickolay


  reply	other threads:[~2026-09-11 15:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-11 15:37 [PATCH v2 0/3] Novatek NT51021 DSI panel IC driver Nickolay Goppen
2026-09-11 15:38 ` [PATCH v2 1/3] dt-bindings: display: panel: Add bindings for Novatek NT51021 Nickolay Goppen
2026-09-13  9:31   ` Krzysztof Kozlowski
2026-09-11 15:38 ` [PATCH v2 2/3] drivers: gpu: drm: panel: Add BOE NT51021 driver Nickolay Goppen
2026-09-11 15:44   ` sashiko-bot
2026-09-11 15:48     ` Nickolay Goppen [this message]
2026-09-11 15:38 ` [PATCH v2 3/3] MAINTAINERS: Add myself as a maintainer of NT51021 panel driver Nickolay Goppen
2026-09-12  2:58 ` [PATCH v2 0/3] Novatek NT51021 DSI panel IC driver Ryan Brue
2026-09-12 12:05   ` Nickolay Goppen
2026-09-12 18:19     ` Ryan Brue

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=d7e15309-8069-45ec-92a6-24ea113a537a@mainlining.org \
    --to=setotau@mainlining.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --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