Skip to content
Commit e9728f0d authored by Dmitry Torokhov's avatar Dmitry Torokhov
Browse files

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: default avatarThierry Reding <thierry.reding@gmail.com>
Tested-by: default avatarDavid Lechner <david@lechnology.com>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 48a55d7d
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment