All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Rosen Penev" <rosenp@gmail.com>, linux-leds@vger.kernel.org
Cc: lee@kernel.org
Subject: Re: [PATCH v2] leds: is31fl32xx: Fix NULL pointer dereference when binding via I2C ID table
Date: Sat, 17 Oct 2026 00:54:11 +0000	[thread overview]
Message-ID: <sashiko-outbox-175083@kernel.org> (raw)
In-Reply-To: <20261017004351.1249547-1-rosenp@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] leds: is31fl32xx: positional initializers used in changed i2c_device_id table
--

commit 7fdebced20c3197505f19872c5b5fdcf8d9db517
Author: Rosen Penev <rosenp@gmail.com>

leds: is31fl32xx: Fix NULL pointer dereference when binding via I2C ID table

This commit populates driver_data in is31fl32xx_id and switches
is31fl32xx_probe() to use i2c_get_match_data() so that devices binding via
the I2C ID table receive a valid chip definition instead of NULL.

> diff --git a/drivers/leds/leds-is31fl32xx.c b/drivers/leds/leds-is31fl32xx.c
> index 285085d274538..5ef4fd649d608 100644
> --- a/drivers/leds/leds-is31fl32xx.c
> +++ b/drivers/leds/leds-is31fl32xx.c

[ ... ]

> @@ -611,19 +611,15 @@ static void is31fl32xx_remove(struct i2c_client *client)
>  			ERR_PTR(ret));
>  }
>  
> -/*
> - * i2c-core (and modalias) requires that id_table be properly filled,
> - * even though it is not used for DeviceTree based instantiation.
> - */
>  static const struct i2c_device_id is31fl32xx_id[] = {
> -	{ .name = "is31fl3293" },
> -	{ .name = "is31fl3236" },
> -	{ .name = "is31fl3236a" },
> -	{ .name = "is31fl3235" },
> -	{ .name = "is31fl3218" },
> -	{ .name = "sn3218" },
> -	{ .name = "is31fl3216" },
> -	{ .name = "sn3216" },
> +	{ "is31fl3293",  (kernel_ulong_t)&is31fl3293_cdef },
> +	{ "is31fl3236",  (kernel_ulong_t)&is31fl3236_cdef },
> +	{ "is31fl3236a", (kernel_ulong_t)&is31fl3236a_cdef },
> +	{ "is31fl3235",  (kernel_ulong_t)&is31fl3235_cdef },
> +	{ "is31fl3218",  (kernel_ulong_t)&is31fl3218_cdef },
> +	{ "sn3218",      (kernel_ulong_t)&is31fl3218_cdef },
> +	{ "is31fl3216",  (kernel_ulong_t)&is31fl3216_cdef },
> +	{ "sn3216",      (kernel_ulong_t)&is31fl3216_cdef },
>  	{ }
>  };
>  

[Severity: Low]
This isn't a bug, but commit a031b5fce526 ("leds: Use named initializers for
arrays of i2c_device_data") previously converted is31fl32xx_id[] in
drivers/leds/leds-is31fl32xx.c to use named initializers.

Should the updated entries in is31fl32xx_id[] keep using named initializers
for .name and .driver_data instead of switching back to positional
initialization?

For example:

	{ .name = "is31fl3293", .driver_data = (kernel_ulong_t)&is31fl3293_cdef },

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261017004351.1249547-1-rosenp@gmail.com?part=1

      reply	other threads:[~2026-10-17  0:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-17  0:43 [PATCH v2] leds: is31fl32xx: Fix NULL pointer dereference when binding via I2C ID table Rosen Penev
2026-10-17  0:54 ` 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=sashiko-outbox-175083@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=lee@kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=rosenp@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 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.