diff options
author | Johan Hovold <johan@kernel.org> | 2016-11-01 11:46:39 +0100 |
---|---|---|
committer | Thierry Reding <thierry.reding@gmail.com> | 2016-11-29 16:43:24 +0100 |
commit | 0e1614ac84f1719d87bed577963bb8140d0c9ce8 (patch) | |
tree | b3ad9192f727ff4df30142331c4fda8c21cdbe93 /drivers/pwm/sysfs.c | |
parent | c699995663b40d61afcc14ca27f0106f13151772 (diff) |
pwm: Fix device reference leak
Make sure to drop the reference to the parent device taken by
class_find_device() after "unexporting" any children when deregistering
a PWM chip.
Fixes: 0733424c9ba9 ("pwm: Unexport children before chip removal")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Diffstat (limited to 'drivers/pwm/sysfs.c')
-rw-r--r-- | drivers/pwm/sysfs.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/pwm/sysfs.c b/drivers/pwm/sysfs.c index 0296d8178ae2..a813239300c3 100644 --- a/drivers/pwm/sysfs.c +++ b/drivers/pwm/sysfs.c @@ -425,6 +425,8 @@ void pwmchip_sysfs_unexport_children(struct pwm_chip *chip) if (test_bit(PWMF_EXPORTED, &pwm->flags)) pwm_unexport_child(parent, pwm); } + + put_device(parent); } static int __init pwm_sysfs_init(void) |