13 Dec
2017
13 Dec
'17
10:18 p.m.
Check number of periods is > 0 other wise return an error and emit some trace.
Signed-off-by: Liam Girdwood liam.r.girdwood@linux.intel.com --- src/audio/host.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/src/audio/host.c b/src/audio/host.c index b731dd6..8f09952 100644 --- a/src/audio/host.c +++ b/src/audio/host.c @@ -412,6 +412,12 @@ static int host_params(struct comp_dev *dev) hd->period_count = cconfig->periods_source; }
+ /* validate period count */ + if (hd->period_count == 0) { + trace_host_error("eS0"); + return -EINVAL; + } + /* calculate period size based on config */ hd->period_bytes = dev->frames * comp_frame_bytes(dev); if (hd->period_bytes == 0) {
--
2.14.1