Skip to content

Commit 566277d

Browse files
committed
smart_amp_test: fix data size check
This will allow to return -EINVAL if wrong size provided. Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
1 parent 771b3d2 commit 566277d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/samples/audio/smart_amp_test.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,12 @@ static inline int smart_amp_get_config(struct comp_dev *dev, char *data,
197197
struct smart_amp_data *sad = comp_get_drvdata(dev);
198198
uint32_t cfg_size;
199199

200-
cfg_size = sizeof(struct smart_amp_data);
200+
cfg_size = sizeof(struct sof_smart_amp_config);
201201

202202
if (cfg_size > *data_size) {
203203
comp_err(dev, "smart_amp_get_config(): wrong config size %d",
204204
*data_size);
205+
return -EINVAL;
205206
}
206207

207208
*data_size = cfg_size;

0 commit comments

Comments
 (0)