pwm: Fix out-of-bounds access in of_pwm_single_xlate()
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Tue, 9 Jan 2024 21:34:31 +0000 (22:34 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jan 2024 23:35:46 +0000 (15:35 -0800)
commite5f2b4b62977fb6c2efcbc5779e0c9dce18215f7
tree0f23277ec071150fa0ef653683fda171b922fe8c
parent080d2c608bcef08579d422b7637920e9caccddc7
pwm: Fix out-of-bounds access in of_pwm_single_xlate()

commit a297d07b9a1e4fb8cda25a4a2363a507d294b7c9 upstream.

With args->args_count == 2 args->args[2] is not defined. Actually the
flags are contained in args->args[1].

Fixes: 3ab7b6ac5d82 ("pwm: Introduce single-PWM of_xlate function")
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/243908750d306e018a3d4bf2eb745d53ab50f663.1704835845.git.u.kleine-koenig@pengutronix.de
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/pwm/core.c