pwm: omap-dmtimer: Remove PWM chip in .remove before making it unfunctional
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Mon, 11 Nov 2019 09:03:54 +0000 (10:03 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 28 Feb 2020 14:42:35 +0000 (15:42 +0100)
commitd8c8434dad4d524b80606d8c487808472dc010d3
treef35456ead8341b57821ebd624f5311b18315ee21
parent3d0850ae2eaea52adc083074646185974d98d25c
pwm: omap-dmtimer: Remove PWM chip in .remove before making it unfunctional

[ Upstream commit 43efdc8f0e6d7088ec61bd55a73bf853f002d043 ]

In the old code (e.g.) mutex_destroy() was called before
pwmchip_remove(). Between these two calls it is possible that a PWM
callback is used which tries to grab the mutex.

Fixes: 6604c6556db9 ("pwm: Add PWM driver for OMAP using dual-mode timers")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pwm/pwm-omap-dmtimer.c