mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-02 09:01:48 -05:00
pcm ioplug: fix some coverity issues (switch, missing unlock in snd_pcm_ioplug_drain())
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
4740dd97bf
commit
ad5aea8922
1 changed files with 3 additions and 0 deletions
|
|
@ -533,6 +533,7 @@ static int snd_pcm_ioplug_drain(snd_pcm_t *pcm)
|
||||||
case SND_PCM_STATE_OPEN:
|
case SND_PCM_STATE_OPEN:
|
||||||
case SND_PCM_STATE_DISCONNECTED:
|
case SND_PCM_STATE_DISCONNECTED:
|
||||||
case SND_PCM_STATE_SUSPENDED:
|
case SND_PCM_STATE_SUSPENDED:
|
||||||
|
snd_pcm_unlock(pcm);
|
||||||
return -EBADFD;
|
return -EBADFD;
|
||||||
case SND_PCM_STATE_PREPARED:
|
case SND_PCM_STATE_PREPARED:
|
||||||
if (pcm->stream == SND_PCM_STREAM_PLAYBACK) {
|
if (pcm->stream == SND_PCM_STREAM_PLAYBACK) {
|
||||||
|
|
@ -545,6 +546,8 @@ static int snd_pcm_ioplug_drain(snd_pcm_t *pcm)
|
||||||
case SND_PCM_STATE_RUNNING:
|
case SND_PCM_STATE_RUNNING:
|
||||||
io->data->state = SND_PCM_STATE_DRAINING;
|
io->data->state = SND_PCM_STATE_DRAINING;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (io->data->state == SND_PCM_STATE_DRAINING) {
|
if (io->data->state == SND_PCM_STATE_DRAINING) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue