Skip to content

Commit 930bd10

Browse files
abonislawskilgirdwood
authored andcommitted
audio: copier: reject ALH multi-gateway config with zero count
copier_alh_assign_dai_index() rejected only count > MAX and count < 0, letting count == 0 pass. A zero count creates a SOF_COMP_DAI copier with endpoint_num == 0 (the dai-creation loop never runs), which later makes copier_position() return -EINVAL before writing posn. Reject count <= 0. Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
1 parent 34a8d7c commit 930bd10

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/audio/copier/copier_dai.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ static int copier_alh_assign_dai_index(struct comp_dev *dev,
108108
}
109109

110110
dai_num = alh_blob->alh_cfg.count;
111-
if (dai_num > IPC4_ALH_MAX_NUMBER_OF_GTW || dai_num < 0) {
111+
if (dai_num > IPC4_ALH_MAX_NUMBER_OF_GTW || dai_num <= 0) {
112112
comp_err(mod->dev, "Invalid dai_count: %d", dai_num);
113113
return -EINVAL;
114114
}
@@ -138,7 +138,7 @@ static int copier_alh_assign_dai_index(struct comp_dev *dev,
138138
}
139139

140140
dai_num = alh_blob->alh_cfg.count;
141-
if (dai_num > IPC4_ALH_MAX_NUMBER_OF_GTW || dai_num < 0) {
141+
if (dai_num > IPC4_ALH_MAX_NUMBER_OF_GTW || dai_num <= 0) {
142142
comp_err(mod->dev, "Invalid dai_count: %d", dai_num);
143143
return -EINVAL;
144144
}

0 commit comments

Comments
 (0)