]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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>
Thu, 3 Aug 2023 08:22:30 +0000 (10:22 +0200)
commit7ac170d93becbbe88cf90f95129c99f69482343c
treee7f23dcacc52b4c005d7f57c1f4a2f55b6089767
parentbae3c43a9d256232f8a0a0126080e9d2913dba54
pwm: meson: fix handling of period/duty if greater than UINT_MAX

[ Upstream commit 87a2cbf02d7701255f9fcca7e5bd864a7bb397cf ]

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: Sasha Levin <sashal@kernel.org>
drivers/pwm/pwm-meson.c