diff options
author | Mark Farrugia <mark.farrugia@fiberdyne.com.au> | 2018-12-18 17:16:08 +1100 |
---|---|---|
committer | Mark Farrugia <mark.farrugia@fiberdyne.com.au> | 2018-12-18 17:16:36 +1100 |
commit | dbfb35abbe8548fe5e33763bcab5a5c04ade0d36 (patch) | |
tree | 63228886fa2a820af9d08bc2f6b566c89c22f605 | |
parent | 4737bc9ffcdd0ec17c8fa7629c15de6d4b30594d (diff) |
Add check for channel count in pcm_open
We need to ensure that this is not set to 0, otherwise audio will not
work properly.
Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
-rw-r--r-- | pcm.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -84,6 +84,10 @@ static int pcm_open(struct snd_pcm_substream *substream) // Setup remaining hw properties chans = stream->channels; + if (chans == 0) { + D_ERRORK("Channels cannot be 0"); + return -EINVAL; + } hw->channels_min = chans; hw->channels_max = chans; |