Skip to content

Commit 96e45e5

Browse files
Colin Ian Kingthierryreding
authored andcommitted
pwm: ep93xx: Fix read of uninitialized variable ret
There is a potential path in function ep93xx_pwm_apply where ret is never assigned a value and it is checked for an error code. Fix this by ensuring ret is zero'd in the success path to avoid this issue. Addresses-Coverity: ("Uninitialized scalar variable") Fixes: f6ef94e ("pwm: ep93xx: Unfold legacy callbacks into ep93xx_pwm_apply()") Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
1 parent b235f8a commit 96e45e5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/pwm/pwm-ep93xx.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ static int ep93xx_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
137137
writew(duty_cycles, base + EP93XX_PWMx_DUTY_CYCLE);
138138
writew(period_cycles, base + EP93XX_PWMx_TERM_COUNT);
139139
}
140+
ret = 0;
140141
} else {
141142
ret = -EINVAL;
142143
}

0 commit comments

Comments
 (0)