Linux Input/HID development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Maurizio Casciano" <mauriziocasciano7@gmail.com>
Cc: linux-input@vger.kernel.org, dmitry.torokhov@gmail.com
Subject: Re: [PATCH v2 1/2] Input: drv260x: Restore configuration after device close
Date: Thu, 27 Aug 2026 23:30:19 +0000	[thread overview]
Message-ID: <20260827233020.416711F000E9@smtp.kernel.org> (raw)
In-Reply-To: <684969b0f53a9e5f83636b219c139e904e74e14f.1787872237.git.mauriziocasciano7@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Repeatedly opening the input device causes unbounded kernel memory growth via regmap_register_patch().
--

commit 7b2939fba808d6cd89b89de289b90816dad3fa8b
Author: Maurizio Casciano <mauriziocasciano7@gmail.com>

Input: drv260x: Restore configuration after device close

This commit restores the actuator configuration by reinitializing the
controller when the input device is opened.

Link: https://lore.kernel.org/linux-input/20260827182855.DE8E91F000E9@smtp.kernel.org/

> diff --git a/drivers/input/misc/drv260x.c b/drivers/input/misc/drv260x.c
> index 6c5c4c53753b1..f26a9052edd2d 100644
> --- a/drivers/input/misc/drv260x.c
> +++ b/drivers/input/misc/drv260x.c
[ ... ]
> @@ -426,6 +424,21 @@ static int drv260x_init(struct drv260x_data *haptics)
>  	return 0;
>  }
>  
> +static int drv260x_open(struct input_dev *input)
> +{
> +	struct drv260x_data *haptics = input_get_drvdata(input);
> +	int error;
> +
> +	gpiod_set_value(haptics->enable_gpio, 1);
> +	usleep_range(250, 500);
> +
> +	error = drv260x_init(haptics);

[Severity: High]
Does this code leak kernel memory?

By calling drv260x_init() on every open, it will repeatedly call
regmap_register_patch() inside drv260x_init().

Since regmap_register_patch() dynamically allocates and appends to the
internal map->patch list on every call, could this cause an unbounded memory
leak if a userspace process repeatedly opens and closes the device?

> +	if (error)
> +		gpiod_set_value(haptics->enable_gpio, 0);
> +
> +	return error;
> +}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/cover.input-v2.1787872237.git.mauriziocasciano7@gmail.com?part=1

  reply	other threads:[~2026-08-27 23:30 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-27 23:16 [PATCH v2 0/2] Input: drv260x: restore configuration across power loss Maurizio Casciano
2026-08-27 23:16 ` [PATCH v2 1/2] Input: drv260x: Restore configuration after device close Maurizio Casciano
2026-08-27 23:30   ` sashiko-bot [this message]
2026-08-29 11:33   ` Dmitry Torokhov
2026-08-29 22:50     ` Maurizio Casciano
2026-08-27 23:16 ` [PATCH v2 2/2] Input: drv260x: Fix suspend and resume sequencing Maurizio Casciano
2026-08-29 12:14   ` Dmitry Torokhov
2026-08-29 22:57     ` [PATCH v3] " Maurizio Casciano
2026-08-29 23:07       ` sashiko-bot
2026-08-30 14:17         ` [PATCH v4] " Maurizio Casciano
2026-08-30 14:30           ` sashiko-bot
2026-08-31  1:00             ` [PATCH v5] " Maurizio Casciano
2026-08-31  1:15               ` sashiko-bot
2026-08-31  8:12                 ` [PATCH v6] " Maurizio Casciano
2026-08-31  8:28                   ` sashiko-bot
2026-08-31 15:03                     ` [PATCH v7] " Maurizio Casciano

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=20260827233020.416711F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=mauriziocasciano7@gmail.com \
    --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