ALSA: fireworks/bebob/dice/oxfw: fix substreams counting at vmalloc failure
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Sat, 29 Aug 2015 01:38:46 +0000 (10:38 +0900)
committerTakashi Iwai <tiwai@suse.de>
Sat, 29 Aug 2015 07:14:41 +0000 (09:14 +0200)
commit22c103cd3dfadff340b3b639e477a3c161cb2104
tree56682b45b4f6d914d6ad2dcd1219b192eeea8cbb
parent6aa6925cad06159dc6e25857991bbc4960821242
ALSA: fireworks/bebob/dice/oxfw: fix substreams counting at vmalloc failure

In PCM core, when hw_params() in each driver returns error, the state of
PCM substream is kept as 'open'. In this case, current drivers for sound
units on IEEE 1394 bus doesn't decrement substream counter in hw_free()
correctly. This causes these drivers to keep streams even if not
required.

This commit fixes this bug. When snd_pcm_lib_alloc_vmalloc_buffer()
fails, hw_params function in each driver returns without incrementing the
counter.

Reported-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Acked-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/firewire/bebob/bebob_pcm.c
sound/firewire/dice/dice-pcm.c
sound/firewire/fireworks/fireworks_pcm.c
sound/firewire/oxfw/oxfw-pcm.c