From: sashiko-bot@kernel.org
To: "Joseph Telaak" <joseph@telaak.dev>
Cc: linux-leds@vger.kernel.org, lee@kernel.org
Subject: Re: [PATCH v3 04/11] leds: rgb: ktd202x: Fix a division by zero with long blinks
Date: Fri, 20 Nov 2026 00:10:38 +0000 [thread overview]
Message-ID: <sashiko-outbox-224249@kernel.org> (raw)
In-Reply-To: <20261119-ktd202x-et6326-v3-4-98b836b1cddc@telaak.dev>
> From: Joseph Telaak <joseph@telaak.dev>
>
> blink_set() works out the on time as delay_on * 256 / (delay_on +
> delay_off) in unsigned long, with delays straight from the timer
> trigger's sysfs files:
>
> - when the two delays add up to exactly 2^32 on 32 bit, or 2^64 on
> 64 bit, the sum wraps to 0 and the kernel divides by zero, for
> example with "echo 2147483648" into both delay_on and delay_off.
> That oopses on x86 and gives an arbitrary result on MIPS and arm64.
> - on 32 bit the product already overflows once delay_on is above about
> 4.6 hours, and a sum that wraps sets the wrong period, so long blinks
> get an arbitrary duty cycle
>
> Saturate the sum, and compute the on time with mul_u64_u64_div_u64().
>
> Fixes: 0ebdb7210943 ("leds: Add ktd202x driver")
> Cc: stable@vger.kernel.org
> Signed-off-by: Joseph Telaak <joseph@telaak.dev>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261119-ktd202x-et6326-v3-0-98b836b1cddc@telaak.dev?part=4
next prev parent reply other threads:[~2026-11-20 0:10 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-20 0:07 [PATCH v3 00/11] leds: ktd202x: Add Etek ET6326, hardware breathing and fixes Joseph Telaak via B4 Relay
2026-11-20 0:07 ` Joseph Telaak
2026-11-20 0:07 ` [PATCH v3 01/11] leds: rgb: ktd202x: Fix the flash period of short blinks on 32 bit Joseph Telaak
2026-11-20 0:07 ` Joseph Telaak via B4 Relay
2026-11-20 0:10 ` sashiko-bot
2026-11-20 0:07 ` [PATCH v3 02/11] leds: rgb: ktd202x: Fix an out-of-bounds read with unused channels Joseph Telaak via B4 Relay
2026-11-20 0:07 ` Joseph Telaak
2026-11-20 0:10 ` sashiko-bot
2026-11-20 0:07 ` [PATCH v3 03/11] leds: rgb: ktd202x: Never program an on time of zero Joseph Telaak via B4 Relay
2026-11-20 0:07 ` Joseph Telaak
2026-11-20 0:10 ` sashiko-bot
2026-11-20 0:07 ` [PATCH v3 04/11] leds: rgb: ktd202x: Fix a division by zero with long blinks Joseph Telaak via B4 Relay
2026-11-20 0:07 ` Joseph Telaak
2026-11-20 0:10 ` sashiko-bot [this message]
2026-11-20 0:07 ` [PATCH v3 05/11] leds: rgb: ktd202x: Keep the unlit colors of a blinking LED off Joseph Telaak via B4 Relay
2026-11-20 0:07 ` Joseph Telaak
2026-11-20 0:11 ` sashiko-bot
2026-11-20 0:07 ` [PATCH v3 06/11] dt-bindings: leds: kinetic,ktd202x: Add Etek ET6326 Joseph Telaak via B4 Relay
2026-11-20 0:07 ` Joseph Telaak
2026-11-20 0:09 ` sashiko-bot
2026-11-20 0:07 ` [PATCH v3 07/11] leds: rgb: ktd202x: Add Etek ET6326 support Joseph Telaak via B4 Relay
2026-11-20 0:07 ` Joseph Telaak
2026-11-20 0:10 ` sashiko-bot
2026-11-20 0:07 ` [PATCH v3 08/11] leds: rgb: ktd202x: Add hardware pattern support Joseph Telaak
2026-11-20 0:07 ` Joseph Telaak via B4 Relay
2026-11-20 0:15 ` sashiko-bot
2026-11-20 0:07 ` [PATCH v3 09/11] leds: rgb: ktd202x: Limit the LED current to led-max-microamp Joseph Telaak via B4 Relay
2026-11-20 0:07 ` Joseph Telaak
2026-11-20 0:13 ` sashiko-bot
2026-11-20 0:07 ` [PATCH v3 10/11] leds: rgb: ktd202x: Fail the probe when the chip does not answer Joseph Telaak via B4 Relay
2026-11-20 0:07 ` Joseph Telaak
2026-11-20 0:12 ` sashiko-bot
2026-11-20 0:07 ` [PATCH v3 11/11] leds: rgb: ktd202x: Don't let a blinking LED retime another one Joseph Telaak via B4 Relay
2026-11-20 0:07 ` Joseph Telaak
2026-11-20 0:25 ` sashiko-bot
2026-11-20 5:14 ` Joseph Telaak
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-224249@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=joseph@telaak.dev \
--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 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.