The set_brightness function of the led_pwm driver uses a default PWM period (defined in the pwms DT property) to compute a pulse passed to the pwm_set_pulse_dt function. If this default period is greater than 2^32/100 nanoseconds (about 43 milliseconds) then the calculation may overflow. This patch prevents this overflow by running the pulse computation under a cast with a larger type (uint64_t). Reported-by: Scott Worley <scott.worley@microchip.com> Signed-off-by: Simon Guinot <simon.guinot@seagate.com> |
||
|---|---|---|
| .. | ||
| CMakeLists.txt | ||
| ht16k33.c | ||
| is31fl3216a.c | ||
| Kconfig | ||
| Kconfig.gpio | ||
| Kconfig.ht16k33 | ||
| Kconfig.is31fl3216a | ||
| Kconfig.lp503x | ||
| Kconfig.lp3943 | ||
| Kconfig.lp5562 | ||
| Kconfig.lp5569 | ||
| Kconfig.npm1300 | ||
| Kconfig.pca9633 | ||
| Kconfig.pwm | ||
| Kconfig.tlc59108 | ||
| Kconfig.xec | ||
| led_context.h | ||
| led_gpio.c | ||
| led_handlers.c | ||
| led_mchp_xec.c | ||
| led_npm1300.c | ||
| led_pwm.c | ||
| led_shell.c | ||
| lp503x.c | ||
| lp3943.c | ||
| lp5562.c | ||
| lp5569.c | ||
| pca9633.c | ||
| tlc59108.c | ||