]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
ALSA: Add a reference counter to card instance
authorTakashi Iwai <tiwai@suse.de>
Tue, 16 Oct 2012 11:05:59 +0000 (13:05 +0200)
committerBen Hutchings <ben@decadent.org.uk>
Fri, 16 Nov 2012 16:46:50 +0000 (16:46 +0000)
commit3b4a36722e5e518e4bdd3a215d8a1c5adc18e911
tree3db0ebb96a886ce6ff3c91e60510a03b561a20bc
parentf6415ce55f2430e38f674d8421511e489b2c71b0
ALSA: Add a reference counter to card instance

commit a0830dbd4e42b38aefdf3fb61ba5019a1a99ea85 upstream.

For more strict protection for wild disconnections, a refcount is
introduced to the card instance, and let it up/down when an object is
referred via snd_lookup_*() in the open ops.

The free-after-last-close check is also changed to check this refcount
instead of the empty list, too.

Reported-by: Matthieu CASTET <matthieu.castet@parrot.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
include/sound/core.h
sound/core/control.c
sound/core/hwdep.c
sound/core/init.c
sound/core/oss/mixer_oss.c
sound/core/oss/pcm_oss.c
sound/core/pcm_native.c
sound/core/rawmidi.c
sound/core/sound.c
sound/core/sound_oss.c