All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pwm: ep93xx: Fix uninitialized variable bug in ep93xx_pwm_apply()
@ 2021-06-30 13:46 Dan Carpenter
  2021-06-30 15:36 ` Uwe Kleine-König
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2021-06-30 13:46 UTC (permalink / raw)
  To: Thierry Reding, Uwe Kleine-König
  Cc: Lee Jones, linux-pwm, linux-kernel, kernel-janitors

Smatch found a potential uninitialized variable in ep93xx_pwm_apply():

    drivers/pwm/pwm-ep93xx.c:147 ep93xx_pwm_apply()
    error: uninitialized symbol 'ret'.

Initialize "ret" to zero at the start to solve this issue.

Fixes: f6ef94edf0f6 ("pwm: ep93xx: Unfold legacy callbacks into ep93xx_pwm_apply()")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/pwm/pwm-ep93xx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pwm/pwm-ep93xx.c b/drivers/pwm/pwm-ep93xx.c
index 70fa2957f9d3..ffa79248c1e1 100644
--- a/drivers/pwm/pwm-ep93xx.c
+++ b/drivers/pwm/pwm-ep93xx.c
@@ -61,7 +61,7 @@ static void ep93xx_pwm_free(struct pwm_chip *chip, struct pwm_device *pwm)
 static int ep93xx_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
 			    const struct pwm_state *state)
 {
-	int ret;
+	int ret = 0;
 	struct ep93xx_pwm *ep93xx_pwm = to_ep93xx_pwm(chip);
 	bool enabled = state->enabled;
 
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] pwm: ep93xx: Fix uninitialized variable bug in ep93xx_pwm_apply()
  2021-06-30 13:46 [PATCH] pwm: ep93xx: Fix uninitialized variable bug in ep93xx_pwm_apply() Dan Carpenter
@ 2021-06-30 15:36 ` Uwe Kleine-König
  2021-07-05  6:42   ` Uwe Kleine-König
  0 siblings, 1 reply; 3+ messages in thread
From: Uwe Kleine-König @ 2021-06-30 15:36 UTC (permalink / raw)
  To: Dan Carpenter, Colin King
  Cc: Thierry Reding, Lee Jones, linux-pwm, linux-kernel, kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 355 bytes --]

Hello,

this problem was found already earlier by Colin King:

	https://lore.kernel.org/r/20210629172253.43131-1-colin.king@canonical.com

I'm fine with either change.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] pwm: ep93xx: Fix uninitialized variable bug in ep93xx_pwm_apply()
  2021-06-30 15:36 ` Uwe Kleine-König
@ 2021-07-05  6:42   ` Uwe Kleine-König
  0 siblings, 0 replies; 3+ messages in thread
From: Uwe Kleine-König @ 2021-07-05  6:42 UTC (permalink / raw)
  To: Dan Carpenter, Colin King
  Cc: Thierry Reding, Lee Jones, linux-pwm, linux-kernel, kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 533 bytes --]

Hello,

On Wed, Jun 30, 2021 at 05:36:00PM +0200, Uwe Kleine-König wrote:
> this problem was found already earlier by Colin King:
> 
> 	https://lore.kernel.org/r/20210629172253.43131-1-colin.king@canonical.com
> 
> I'm fine with either change.

FTR: Thierry applied Colin's patch, so I'm discarding this one from
patchwork as not applicable.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-07-05  6:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-30 13:46 [PATCH] pwm: ep93xx: Fix uninitialized variable bug in ep93xx_pwm_apply() Dan Carpenter
2021-06-30 15:36 ` Uwe Kleine-König
2021-07-05  6:42   ` Uwe Kleine-König

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.