diff options
author | Mark Farrugia <mark.farrugia@fiberdyne.com.au> | 2019-01-29 18:46:58 +1100 |
---|---|---|
committer | Mark Farrugia <mark.farrugia@fiberdyne.com.au> | 2019-01-29 18:46:58 +1100 |
commit | 450838ec65119149cff3cdfa97f5cecfa5173ee5 (patch) | |
tree | ea61cf3996f3166ecf26ba2be4a13a9745151edf /pcm.c | |
parent | 5e431d7a48d5e4ca0e2c040af1ef10dfaf0eba92 (diff) |
Check if card is sealed before attempting to map a streamhalibut_7.90.0halibut/7.90.07.90.0
Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
Diffstat (limited to 'pcm.c')
-rw-r--r-- | pcm.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -67,6 +67,11 @@ static int pcm_open(struct snd_pcm_substream *substream) struct snd_pcm_hardware *hw; unsigned int chans = 0; + if (!snd_avirt_streams_sealed()) { + D_ERRORK("Cannot open PCM. Card is not sealed"); + return -EPERM; + } + // Find the Audio Path mapped to this device stream = snd_avirt_stream_find_by_device(substream->pcm->device); if (IS_ERR_VALUE(stream) || !stream) |