[PATCH 0/5] pwm: fix overflow, truncation and error-path reference leaks
shao.mingyin at zte.com.cn
shao.mingyin at zte.com.cn
Fri Nov 6 08:07:24 PST 2026
Five independent defects in four PWM drivers, found while reviewing
linux-next next-20261030. Two are 32-bit overflows that make the
hardware readback report a wrong period or duty cycle, one is a 16-bit
truncation of the on/off counters, and two are missing clock or
runtime-PM cleanups on error paths. All are reachable from the PWM
sysfs interface or from the hardware readback path.
The series is ordered by impact and is independent patch-by-patch; each
patch applies on its own and taking a subset is fine. Patches 1 and 4
both touch pwm-dwc-core.c but different callbacks (dwc_pwm_get_state()
and dwc_pwm_apply()), so they can be applied separately.
1/5 pwm: dwc: Fix 32 bit overflow when computing duty/period in get_state
2/5 pwm: airoha: Fix 32 bit overflow when converting duty ticks to ns
3/5 pwm: adp5585: Clamp on/off counters to the 16 bit register range
4/5 pwm: dwc: Balance the runtime PM reference when configuring fails
5/5 pwm: rockchip: Fix pclk leak in get_state error path
Shao Mingyin (5):
pwm: dwc: Fix 32 bit overflow when computing duty/period in get_state
pwm: airoha: Fix 32 bit overflow when converting duty ticks to ns
pwm: adp5585: Clamp on/off counters to the 16 bit register range
pwm: dwc: Balance the runtime PM reference when configuring fails
pwm: rockchip: Fix pclk leak in get_state error path
drivers/pwm/pwm-adp5585.c | 7 +++++++
drivers/pwm/pwm-airoha.c | 8 ++++----
drivers/pwm/pwm-dwc-core.c | 12 ++++++++----
drivers/pwm/pwm-rockchip.c | 6 +++++-
4 files changed, 24 insertions(+), 9 deletions(-)
---
base-commit: 7649ba73f9e7e1e04d0b46213e39c79ae09dd55c
More information about the Linux-rockchip
mailing list