Uwe Kleine-König c6837aa180 pwm: Don't check pointer for being non-NULL after use
After assigning chip = pwm->chip; the compiler is free to assume that
pwm is non-NULL and so can optimize out the check for pwm against NULL.

While it's probably a programming error to pass a NULL pointer to
pwm_put() this shouldn't be dropped without careful consideration and
wasn't intended.

So assign chip only after the NULL check.

Reported-by: David Lechner <dlechner@baylibre.com>
Link: https://lore.kernel.org/r/66a6f562-1fdd-4e45-995a-e7995432aa0c@baylibre.com
Fixes: 4c56b1434b81 ("pwm: Add a struct device to struct pwm_chip")
Link: https://lore.kernel.org/r/20240329101648.544155-2-u.kleine-koenig@pengutronix.de
Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
2024-04-30 18:56:55 +02:00
..
2024-04-05 17:21:16 -07:00
2024-04-11 16:49:11 -07:00
2024-04-09 16:29:48 +02:00
2024-04-11 16:23:56 -07:00
2024-04-19 14:02:21 -07:00
2024-04-09 17:01:01 -07:00
2024-04-09 16:17:37 +02:00
2024-03-27 13:17:15 +01:00
2024-03-31 11:23:51 -07:00
2024-04-18 07:15:33 -07:00
2024-04-19 09:59:15 -07:00
2024-04-11 16:23:56 -07:00
2024-04-19 16:07:18 +02:00