summaryrefslogtreecommitdiffstats
path: root/configfs.c
diff options
context:
space:
mode:
authorMark Farrugia <mark.farrugia@fiberdyne.com.au>2019-02-13 11:36:07 +1100
committerMark Farrugia <mark.farrugia@fiberdyne.com.au>2019-02-13 11:36:27 +1100
commit97bcf6cff68ac8f534e11f5382731bd3649b32ea (patch)
tree36a09cd0e11a79078f0fadb3f56be87dabcb5dfa /configfs.c
parent0e2278875ea5ec6777018cc792adcc34b8463050 (diff)
Ensure number of channels in configfs is greater than 0
Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
Diffstat (limited to 'configfs.c')
-rw-r--r--configfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/configfs.c b/configfs.c
index a22c75f..4792f87 100644
--- a/configfs.c
+++ b/configfs.c
@@ -79,7 +79,7 @@ static ssize_t cfg_snd_avirt_stream_channels_store(struct config_item *item,
if (err < 0)
return err;
- if (tmp > INT_MAX)
+ if ((tmp > INT_MAX) || (tmp == 0))
return -ERANGE;
stream->channels = tmp;