Input: pwm-beeper - fix race when suspending
Usually userspace sends SND_BELL and SND_TONE events, and by the time pwm_beeper_suspend() runs userpsace is already frozen, but theoretically in-kernel users may send these events too, and that may cause pwm_beeper_event() scheduling another work after we canceled it. Let's introduce a "suspended" flag and check it in pwm_beeper_event() to avoid this race. Reviewed-by: NThierry Reding <thierry.reding@gmail.com> Tested-by: NDavid Lechner <david@lechnology.com> Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
Showing
想要评论请 注册 或 登录