pwm: imx: Signedness bug in imx_pwm_get_state()
Subsystems (3)
PATCH 1/1 pwm: imx: Signedness bug in imx_pwm_get_state()
"ret" only holds zero and negative error codes. It needs to be signed for the error handling to work.
--- drivers/pwm/pwm-imx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/pwm/pwm-imx.c +2 -1
@@ -128,8 +128,9 @@ static void imx_pwm_get_state(struct pwm_chip *chip, struct pwm_device *pwm, struct pwm_state *state) { struct imx_chip *imx = to_imx_chip(chip); -u32 period, prescaler, pwm_clk, ret, val; +u32 period, prescaler, pwm_clk, val;u64 tmp; +int ret; ret =imx_pwm_clk_prepare_enable (chip);if (ret <0 )
Signature · 1 line
2.17.1
Quoted 5 lines · Dan Carpenter
"ret" only holds zero and negative error codes. It needs to be signed for the error handling to work.
Fixes 9f4c8f9607c3 ("pwm: imx: Add ipg clock operation")Signed-off-by Dan Carpenter <[email protected]>
I would have expected a compiler warning but at least for me there is none emitted. Hmm.
@Thierry: Given that this is a fix I assume you want to apply this patch before my pwm-imx series (which is cleanup only). This will conflict for sure with my driver splitting patch. Please tell me if/when I should resend my series rebased on top of this patch.
Best regards
Uwe
Signature · 2 lines
Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | http://www.pengutronix.de/ |
Quoted 10 lines · Uwe Kleine-König
Quoted 5 lines · Dan Carpenter
"ret" only holds zero and negative error codes. It needs to be signed for the error handling to work.
Fixes 9f4c8f9607c3 ("pwm: imx: Add ipg clock operation")Signed-off-by Dan Carpenter <[email protected]>I would have expected a compiler warning but at least for me there is none emitted. Hmm.
Quoted 6 lines
Reviewed-by Uwe Kleine-König <[email protected]>@Thierry: Given that this is a fix I assume you want to apply this patch before my pwm-imx series (which is cleanup only). This will conflict for sure with my driver splitting patch. Please tell me if/when I should resend my series rebased on top of this patch.
It's fine, I manually applied this on top of the driver split patch.
Thierry