OSDN Git Service

ALSA: timer: Call notifier in the same spinlock
authorTakashi Iwai <tiwai@suse.de>
Wed, 10 Feb 2016 11:47:03 +0000 (12:47 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 26 May 2018 06:48:49 +0000 (08:48 +0200)
commitbea8a671cee74232bbeef3980354cb9b305f6a9f
tree07429cd7e302db62dc059faaf7bad7f0dab8be11
parent957adaae7d228f5be44ed0e4ea926dc8e3d45caf
ALSA: timer: Call notifier in the same spinlock

commit f65e0d299807d8a11812845c972493c3f9a18e10 upstream.

snd_timer_notify1() is called outside the spinlock and it retakes the
lock after the unlock.  This is rather racy, and it's safer to move
snd_timer_notify() call inside the main spinlock.

The patch also contains a slight refactoring / cleanup of the code.
Now all start/stop/continue/pause look more symmetric and a bit better
readable.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Cc: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/core/timer.c