All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Uwe Kleine-König (The Capable Hub)" <u.kleine-koenig@baylibre.com>
Cc: imx@lists.linux.dev, mfd@lists.linux.dev, Frank.Li@kernel.org,
	lee@kernel.org, wsa+renesas@sang-engineering.com
Subject: Re: [PATCH v2 13/23] mfd: Use named initializers for arrays of i2c_device_id
Date: Wed, 08 Jul 2026 11:24:49 +0000	[thread overview]
Message-ID: <20260708112449.D676D1F00A3D@smtp.kernel.org> (raw)
In-Reply-To: <5aec0fc2ac0cd1d2e27027ad0c180e2647bd494e.1783507945.git.u.kleine-koenig@baylibre.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The `rsmu_i2c_id` array is missing its required null-terminating sentinel element.
--

--- Patch [13]: [PATCH v2 13/23] mfd: Use named initializers for arrays of i2c_device_id ---
commit f026cb9dcb83c5116a80b49dec846447e0d9699f
Author: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>

mfd: Use named initializers for arrays of i2c_device_id

This patch updates arrays of i2c_device_id to use named initializers
instead of relying on positional initializers. This improves robustness
against future changes to the struct.

> --- a/drivers/mfd/rsmu_i2c.c
> +++ b/drivers/mfd/rsmu_i2c.c

[ ... ]

> @@ -328,14 +328,13 @@ static void rsmu_i2c_remove(struct i2c_client *client)
>  }
>  
>  static const struct i2c_device_id rsmu_i2c_id[] = {
> -	{ "8a34000",  RSMU_CM },
> -	{ "8a34001",  RSMU_CM },
> -	{ "8a34002",  RSMU_CM },
> -	{ "82p33810", RSMU_SABRE },
> -	{ "82p33811", RSMU_SABRE },
> -	{ "8v19n850", RSMU_SL },
> -	{ "8v19n851", RSMU_SL },
> -	{}
> +	{ .name = "8a34000",  .driver_data = RSMU_CM },
> +	{ .name = "8a34001",  .driver_data = RSMU_CM },
> +	{ .name = "8a34002",  .driver_data = RSMU_CM },
> +	{ .name = "82p33810", .driver_data = RSMU_SABRE },
> +	{ .name = "82p33811", .driver_data = RSMU_SABRE },
> +	{ .name = "8v19n850", .driver_data = RSMU_SL },
> +	{ .name = "8v19n851", .driver_data = RSMU_SL },
>  };

[Severity: High]
Will this lead to an out-of-bounds read during device matching? The
terminating null sentinel was inadvertently removed from the end of the
rsmu_i2c_id array. 

The I2C subsystem (specifically i2c_match_id()) loops over i2c_device_id
arrays until it encounters an element with an empty name string, so it will
now read past the end of the array.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1783507945.git.u.kleine-koenig@baylibre.com?part=13

  reply	other threads:[~2026-07-08 11:24 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-08 11:15 [PATCH v2 00/23] mfd: Use named initializers for arrays of *_device_data Uwe Kleine-König (The Capable Hub)
2026-07-08 11:15 ` Uwe Kleine-König (The Capable Hub)
2026-07-08 11:15 ` [PATCH v2 01/23] mfd: bcm2835-pm: Remove member of struct bcm2835_pm that is only used locally Uwe Kleine-König (The Capable Hub)
2026-07-10 10:20   ` Stanimir Varbanov
2026-07-08 11:15 ` [PATCH v2 02/23] mfd: bcm2835-pm: Drop unused header Uwe Kleine-König (The Capable Hub)
2026-07-08 11:15 ` [PATCH v2 03/23] mfd: kempld: Simplify device abstraction Uwe Kleine-König (The Capable Hub)
2026-07-08 11:15 ` [PATCH v2 04/23] mfd: lp87565: Explicitly set driver data for the generic dt compatible Uwe Kleine-König (The Capable Hub)
2026-07-08 11:15 ` [PATCH v2 05/23] mfd: mt6360: Drop irrelevant __maybe_unused Uwe Kleine-König (The Capable Hub)
2026-07-08 11:15 ` [PATCH v2 06/23] mfd: rt4831: " Uwe Kleine-König (The Capable Hub)
2026-07-08 11:15 ` [PATCH v2 07/23] mfd: loongson-se: Drop unused assignment of acpi_device_id driver data Uwe Kleine-König (The Capable Hub)
2026-07-08 11:15 ` [PATCH v2 08/23] mfd: Drop unused assignment of i2c_device_id " Uwe Kleine-König (The Capable Hub)
2026-07-08 11:15 ` [PATCH v2 09/23] mfd: Drop unused assignment of platform_device_id " Uwe Kleine-König (The Capable Hub)
2026-07-08 11:15 ` [PATCH v2 10/23] mfd: Drop unused assignment of spi_device_id " Uwe Kleine-König (The Capable Hub)
2026-07-08 11:15 ` [PATCH v2 11/23] mfd: Use named initializers for acpi_device_id arrays Uwe Kleine-König (The Capable Hub)
2026-07-08 12:07   ` Charles Keepax
2026-07-08 11:15 ` [PATCH v2 12/23] mfd: intel-m10-bmc-pmci: Use named initializers for dfl_device_id array Uwe Kleine-König (The Capable Hub)
2026-07-08 11:15 ` [PATCH v2 13/23] mfd: Use named initializers for arrays of i2c_device_id Uwe Kleine-König (The Capable Hub)
2026-07-08 11:24   ` sashiko-bot [this message]
2026-07-08 12:12   ` Charles Keepax
2026-07-08 12:55   ` André Draszik
2026-07-08 11:15 ` [PATCH v2 14/23] mfd: twl6030: Use named initializers for of_device_id Uwe Kleine-König (The Capable Hub)
2026-07-08 11:15 ` [PATCH v2 15/23] mfd: Use PCI_DEVICE* macros to initialize pci_device_id arrays Uwe Kleine-König (The Capable Hub)
2026-07-08 11:15 ` [PATCH v2 16/23] mfd: Use named initializers for platform_device_id array Uwe Kleine-König (The Capable Hub)
2026-07-09 19:35   ` Linus Walleij
2026-07-08 11:15 ` [PATCH v2 17/23] mfd: Use named initializers for arrays of spi_device_id Uwe Kleine-König (The Capable Hub)
2026-07-08 12:14   ` Charles Keepax
2026-07-08 11:15 ` [PATCH v2 18/23] mfd: Unify style of acpi_device_id arrays Uwe Kleine-König (The Capable Hub)
2026-07-08 11:20   ` Andy Shevchenko
2026-07-08 12:14   ` Charles Keepax
2026-07-08 11:15 ` [PATCH v2 19/23] mfd: Unify style of dmi_system_id arrays Uwe Kleine-König (The Capable Hub)
2026-07-08 11:15 ` [PATCH v2 20/23] mfd: Unify style of i2c_device_id arrays Uwe Kleine-König (The Capable Hub)
2026-07-08 12:15   ` Charles Keepax
2026-07-08 11:15 ` [PATCH v2 21/23] mfd: Unify style of of_device_id arrays Uwe Kleine-König (The Capable Hub)
2026-07-08 11:15   ` Uwe Kleine-König (The Capable Hub)
2026-07-08 11:32   ` sashiko-bot
2026-07-08 11:32     ` sashiko-bot
2026-07-08 12:18   ` Charles Keepax
2026-07-08 12:18     ` Charles Keepax
2026-07-08 12:58   ` André Draszik
2026-07-08 12:58     ` André Draszik
2026-07-10 19:36   ` Linus Walleij
2026-07-10 19:36     ` Linus Walleij
2026-07-08 11:15 ` [PATCH v2 22/23] mfd: Unify style of pci_device_id arrays Uwe Kleine-König (The Capable Hub)
2026-07-08 11:15 ` [PATCH v2 23/23] mfd: Unify style of spi_device_id arrays Uwe Kleine-König (The Capable Hub)
2026-07-08 12:19   ` Charles Keepax
2026-07-08 11:34 ` [PATCH v2 00/23] mfd: Use named initializers for arrays of *_device_data Andy Shevchenko
2026-07-08 11:34   ` Andy Shevchenko
2026-07-09 16:08   ` Uwe Kleine-König (The Capable Hub)
2026-07-09 16:08     ` Uwe Kleine-König (The Capable Hub)

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=20260708112449.D676D1F00A3D@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Frank.Li@kernel.org \
    --cc=imx@lists.linux.dev \
    --cc=lee@kernel.org \
    --cc=mfd@lists.linux.dev \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=u.kleine-koenig@baylibre.com \
    --cc=wsa+renesas@sang-engineering.com \
    /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.