From: Jaroslav Kysela Date: Wed, 23 May 2018 08:36:17 +0000 (+0200) Subject: pcm ioplug: fix some coverity issues (switch, missing unlock in snd_pcm_ioplug_drain()) X-Git-Tag: v1.1.7~31 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=ad5aea89226f131f27790c98c4638e4596060f81;p=alsa-lib.git pcm ioplug: fix some coverity issues (switch, missing unlock in snd_pcm_ioplug_drain()) Signed-off-by: Jaroslav Kysela --- diff --git a/src/pcm/pcm_ioplug.c b/src/pcm/pcm_ioplug.c index db64853b..4d44ae22 100644 --- a/src/pcm/pcm_ioplug.c +++ b/src/pcm/pcm_ioplug.c @@ -533,6 +533,7 @@ static int snd_pcm_ioplug_drain(snd_pcm_t *pcm) case SND_PCM_STATE_OPEN: case SND_PCM_STATE_DISCONNECTED: case SND_PCM_STATE_SUSPENDED: + snd_pcm_unlock(pcm); return -EBADFD; case SND_PCM_STATE_PREPARED: 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: io->data->state = SND_PCM_STATE_DRAINING; break; + default: + break; } if (io->data->state == SND_PCM_STATE_DRAINING) {