pwm: meson: fix handling of period/duty if greater than UINT_MAX
authorHeiner Kallweit <hkallweit1@gmail.com>
Wed, 24 May 2023 19:48:36 +0000 (21:48 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 23 Jul 2023 11:49:46 +0000 (13:49 +0200)
commit2e9a46e46786bc8822dd8575cdd9292e2796d6bc
tree696500f08d657f65bc76078d5c403310953b8696
parentba1ede19e601b579fd73eaa0ffc55d40a15318a6
pwm: meson: fix handling of period/duty if greater than UINT_MAX

commit 87a2cbf02d7701255f9fcca7e5bd864a7bb397cf upstream.

state->period/duty are of type u64, and if their value is greater than
UINT_MAX, then the cast to uint will cause problems. Fix this by
changing the type of the respective local variables to u64.

Fixes: b79c3670e120 ("pwm: meson: Don't duplicate the polarity internally")
Cc: stable@vger.kernel.org
Suggested-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/pwm/pwm-meson.c