summaryrefslogtreecommitdiffstats
path: root/drivers/pwm/sysfs.c
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2016-11-01 11:46:39 +0100
committerThierry Reding <thierry.reding@gmail.com>2016-11-29 16:43:24 +0100
commit0e1614ac84f1719d87bed577963bb8140d0c9ce8 (patch)
treeb3ad9192f727ff4df30142331c4fda8c21cdbe93 /drivers/pwm/sysfs.c
parentpwm: meson: Add missing spin_lock_init() (diff)
downloadlinux-0e1614ac84f1719d87bed577963bb8140d0c9ce8.tar.xz
linux-0e1614ac84f1719d87bed577963bb8140d0c9ce8.zip
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 '')
-rw-r--r--drivers/pwm/sysfs.c2
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)