diff options
author | Colin Ian King <colin.king@canonical.com> | 2021-06-29 20:22:53 +0300 |
---|---|---|
committer | Thierry Reding <thierry.reding@gmail.com> | 2021-06-30 20:12:21 +0300 |
commit | 96e45e5202377da39d086ec19f8934ebcc5b0fd6 (patch) | |
tree | 8761478f13555305b4fad7eb510a320f940e528c /drivers/pwm/pwm-ep93xx.c | |
parent | b235f8a39fc3ee09c804bf711c3039f92d867549 (diff) | |
download | linux-96e45e5202377da39d086ec19f8934ebcc5b0fd6.tar.xz |
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>
Diffstat (limited to 'drivers/pwm/pwm-ep93xx.c')
-rw-r--r-- | drivers/pwm/pwm-ep93xx.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/pwm/pwm-ep93xx.c b/drivers/pwm/pwm-ep93xx.c index 70fa2957f9d3..8a3d781e6514 100644 --- a/drivers/pwm/pwm-ep93xx.c +++ b/drivers/pwm/pwm-ep93xx.c @@ -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; } |