Skip to content

Commit 63faf32

Browse files
richard-bootlinUwe Kleine-König
authored andcommitted
pwm: max7360: Populate missing .sizeof_wfhw in max7360_pwm_ops
The sizeof_wfhw field wasn't populated in max7360_pwm_ops so it was set to 0 by default. While this is ok for now because: sizeof(struct max7360_pwm_waveform) < PWM_WFHWSIZE in the future, if struct max7360_pwm_waveform grows, it could lead to stack corruption. Fixes: d93a75d ("pwm: max7360: Add MAX7360 PWM support") Signed-off-by: Richard Genoud <richard.genoud@bootlin.com> Link: https://patch.msgid.link/20260113163907.368919-1-richard.genoud@bootlin.com Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
1 parent c198b77 commit 63faf32

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/pwm/pwm-max7360.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ static int max7360_pwm_read_waveform(struct pwm_chip *chip,
153153
}
154154

155155
static const struct pwm_ops max7360_pwm_ops = {
156+
.sizeof_wfhw = sizeof(struct max7360_pwm_waveform),
156157
.request = max7360_pwm_request,
157158
.round_waveform_tohw = max7360_pwm_round_waveform_tohw,
158159
.round_waveform_fromhw = max7360_pwm_round_waveform_fromhw,

0 commit comments

Comments
 (0)