diff options
-rw-r--r-- | drivers/pwm/core.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c index 32871687c0a4..18574857641e 100644 --- a/drivers/pwm/core.c +++ b/drivers/pwm/core.c @@ -1525,11 +1525,13 @@ EXPORT_SYMBOL_GPL(pwm_get); */ void pwm_put(struct pwm_device *pwm) { - struct pwm_chip *chip = pwm->chip; + struct pwm_chip *chip; if (!pwm) return; + chip = pwm->chip; + mutex_lock(&pwm_lock); if (!test_and_clear_bit(PWMF_REQUESTED, &pwm->flags)) { |