Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Markuss Broks" <markuss.broks@gmail.com>
Cc: linux-input@vger.kernel.org, robh@kernel.org,
	conor+dt@kernel.org, devicetree@vger.kernel.org,
	dmitry.torokhov@gmail.com
Subject: Re: [PATCH 3/5] Input: imagis - replace the protocol_b flag with a protocol enum
Date: Fri, 21 Aug 2026 21:37:50 +0000	[thread overview]
Message-ID: <20260821213750.EAB641F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260822-imagis-40xx-v1-3-73e6d6cdf110@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] Missing i2c_set_clientdata() in probe leads to a NULL pointer dereference during system suspend and resume.
--

--- Patch [3]: [PATCH 3/5] Input: imagis - replace the protocol_b flag with a protocol enum ---
commit 83084be7bf2e640e645cd6ac0416107ab34ef58c
Author: Markuss Broks <markuss.broks@gmail.com>
Subject: Input: imagis - replace the protocol_b flag with a protocol enum

This commit replaces the protocol_b flag in the imagis driver with a protocol
enum to describe each reporting format. The change clarifies the naming
convention and prevents a confusing collection of booleans as new chip formats
are added. No functional changes are intended.

> diff --git a/drivers/input/touchscreen/imagis.c b/drivers/input/touchscreen/imagis.c
> index 7cc91f97c06e0..6552d97efe32e 100644
> --- a/drivers/input/touchscreen/imagis.c
> +++ b/drivers/input/touchscreen/imagis.c
[ ... ]
> @@ -442,6 +451,7 @@ static const struct imagis_properties imagis_3038h_data = {
>  	.touch_coord_cmd = IST3038C_REG_TOUCH_COORD,
>  	.whoami_cmd = IST3038C_REG_CHIPID,
>  	.whoami_val = IST3038H_WHOAMI,
> +	.protocol = IMAGIS_PROTOCOL_SHARED_REGISTER,
>  };
>  
>  static const struct of_device_id imagis_of_match[] = {

[Severity: High]
This isn't a bug introduced by this patch, but could a missing
i2c_set_clientdata() in probe lead to a NULL pointer dereference during system
suspend and resume?

The imagis_probe() function dynamically allocates the imagis_ts structure but
never stores it in the device's driver data via i2c_set_clientdata().

When the system later suspends or resumes, imagis_suspend() and imagis_resume()
retrieve the client data using i2c_get_clientdata(), which would return NULL.
The code then immediately dereferences this NULL pointer:

drivers/input/touchscreen/imagis.c:imagis_suspend() {
	struct i2c_client *client = to_i2c_client(dev);
	struct imagis_ts *ts = i2c_get_clientdata(client);
	int error;

	guard(mutex)(&ts->input_dev->mutex);
...

Will this cause a kernel panic during suspend and resume cycles?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260822-imagis-40xx-v1-0-73e6d6cdf110@gmail.com?part=3

  reply	other threads:[~2026-08-21 21:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-21 21:30 [PATCH 0/5] Minor Imagis driver refactoring and support for IST4050 Markuss Broks via B4 Relay
2026-08-21 21:30 ` [PATCH 1/5] dt-bindings: input: touchscreen: imagis: add compatible " Markuss Broks via B4 Relay
2026-08-24 16:17   ` Conor Dooley
2026-08-21 21:30 ` [PATCH 2/5] Input: imagis - do not report coordinates of released contacts Markuss Broks via B4 Relay
2026-08-21 21:39   ` sashiko-bot
2026-08-21 21:30 ` [PATCH 3/5] Input: imagis - replace the protocol_b flag with a protocol enum Markuss Broks via B4 Relay
2026-08-21 21:37   ` sashiko-bot [this message]
2026-08-21 21:30 ` [PATCH 4/5] Input: imagis - add support for the IST40xx touch reporting format Markuss Broks via B4 Relay
2026-08-21 21:43   ` sashiko-bot
2026-08-21 21:30 ` [PATCH 5/5] Input: imagis - add support for IST4050 Markuss Broks via B4 Relay
2026-08-21 21:42   ` sashiko-bot

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=20260821213750.EAB641F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=markuss.broks@gmail.com \
    --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