Messages in this thread | | | Date | Fri, 20 Jan 2017 11:14:21 +0100 | From | Thierry Reding <> | Subject | Re: [PATCH v2 4/7] Input: pwm-beeper - fix race when suspending |
| |
On Thu, Jan 19, 2017 at 02:40:54PM -0800, Dmitry Torokhov wrote: > 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. > > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> > --- > drivers/input/misc/pwm-beeper.c | 21 ++++++++++++++++++--- > 1 file changed, 18 insertions(+), 3 deletions(-)
Reviewed-by: Thierry Reding <thierry.reding@gmail.com> [unhandled content-type:application/pgp-signature] | |