OSDN Git Service

pcm: fix __snd_pcm_state() return value
authorJaroslav Kysela <perex@perex.cz>
Sun, 27 Dec 2020 12:29:33 +0000 (13:29 +0100)
committerJaroslav Kysela <perex@perex.cz>
Sun, 27 Dec 2020 12:31:57 +0000 (13:31 +0100)
commit36aff79747b23b9535e81befe8b7b2972837bce3
tree5dfe88189d07f6c9ad1813ac1dd6b58ffcfc672c
parent9ebd29d2d31df0f8967f3e60cf24bb63c95d4984
pcm: fix __snd_pcm_state() return value

The __snd_pcm_state() must return a valid state, not an error value
when the plugin callback is not defined. Use the first state
SND_PCM_STATE_OPEN - the other functions will return the error
code depending on this state.

Link: https://lore.kernel.org/alsa-devel/20201226213547.175071-10-alexhenrie24@gmail.com/
Reported-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
src/pcm/pcm_local.h