mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 22:21:40 +00:00
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: f6ef94edf0f6 ("pwm: ep93xx: Unfold legacy callbacks into ep93xx_pwm_apply()") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
This commit is contained in:
parent
b235f8a39f
commit
96e45e5202
@ -137,6 +137,7 @@ static int ep93xx_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
|
||||
writew(duty_cycles, base + EP93XX_PWMx_DUTY_CYCLE);
|
||||
writew(period_cycles, base + EP93XX_PWMx_TERM_COUNT);
|
||||
}
|
||||
ret = 0;
|
||||
} else {
|
||||
ret = -EINVAL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user