pwm: Zero-initialize the pwm_state passed to driver's .get_state()
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Wed, 22 Mar 2023 21:45:45 +0000 (22:45 +0100)
committerThierry Reding <thierry.reding@gmail.com>
Thu, 23 Mar 2023 13:44:43 +0000 (14:44 +0100)
commit1271a7b98e7989ba6bb978e14403fc84efe16e13
treef5dddb574ebd830743af205b0ba19b913c742596
parent8caa81eb950cb2e9d2d6959b37d853162d197f57
pwm: Zero-initialize the pwm_state passed to driver's .get_state()

This is just to ensure that .usage_power is properly initialized and
doesn't contain random stack data. The other members of struct pwm_state
should get a value assigned in a successful call to .get_state(). So in
the absence of bugs in driver implementations, this is only a safe-guard
and no fix.

Reported-by: Munehisa Kamata <kamatam@amazon.com>
Link: https://lore.kernel.org/r/20230310214004.2619480-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/core.c