提交 0e1614ac 编写于 作者: J Johan Hovold 提交者: Thierry Reding

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: 0733424c ("pwm: Unexport children before chip removal")
Signed-off-by: NJohan Hovold <johan@kernel.org>
Signed-off-by: NThierry Reding <thierry.reding@gmail.com>
上级 c6999956
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册