From: sashiko-bot@kernel.org
To: "Cong Nguyen" <congnt264@gmail.com>
Cc: linux-leds@vger.kernel.org, lee@kernel.org
Subject: Re: [PATCH v2] leds: rgb: ktd202x: allocate the LED array for the chip's LED count
Date: Wed, 25 Nov 2026 13:02:38 +0000 [thread overview]
Message-ID: <sashiko-outbox-233431@kernel.org> (raw)
In-Reply-To: <20261125125719.2565828-1-congnt264@gmail.com>
> ktd202x_probe() allocates chip->leds[] with one entry per LED child node.
> The allocation helper sets chip->num_leds to that count, but probe then
> overwrites it with the number of LEDs the chip supports (3 for KTD2026,
> 4 for KTD2027).
>
> If the firmware describes fewer LEDs than the chip supports,
> ktd202x_chip_in_use() reads entries past the end of the allocation each
> time a brightness is set.
>
> Allocate the array with the number of LEDs the chip supports, and set
> chip->num_leds right after the allocation, because the helper only sets
> the counter on compilers that support __builtin_counted_by_ref. Entries
> without a firmware node stay zeroed.
>
> Fixes: 0ebdb7210943 ("leds: Add ktd202x driver")
> Signed-off-by: Cong Nguyen <congnt264@gmail.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261125125719.2565828-1-congnt264@gmail.com?part=1
prev parent reply other threads:[~2026-11-25 13:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-25 12:57 [PATCH v2] leds: rgb: ktd202x: allocate the LED array for the chip's LED count Cong Nguyen
2026-11-25 13:02 ` 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-233431@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=congnt264@gmail.com \
--cc=lee@kernel.org \
--cc=linux-leds@vger.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