diff options
author | Chao Song <chao.song@linux.intel.com> | 2022-12-08 14:40:04 +0800 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2023-01-23 19:02:23 +0100 |
commit | deaa1635cc284ab7e7083b9ce7d25a49fd653626 (patch) | |
tree | 51f42226ba53b95f0cb449ffb1ea18b55a4074bc | |
parent | 8871d51aa1e2ab0ce35d00f76153f3e0aa860ee5 (diff) | |
download | alsa-utils-deaa1635cc284ab7e7083b9ce7d25a49fd653626.tar.gz |
topology: propagate nhlt plugin error to main program
Let's propagate nhlt plugin error to main program,
so that we don't generate a wrong nhlt blob silently.
Fixes: https://github.com/alsa-project/alsa-utils/pull/181
Signed-off-by: Chao Song <chao.song@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
-rw-r--r-- | topology/nhlt/intel/ssp/ssp-process.c | 3 | ||||
-rw-r--r-- | topology/pre-processor.c | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/topology/nhlt/intel/ssp/ssp-process.c b/topology/nhlt/intel/ssp/ssp-process.c index 39e95e5..657b9d9 100644 --- a/topology/nhlt/intel/ssp/ssp-process.c +++ b/topology/nhlt/intel/ssp/ssp-process.c @@ -521,7 +521,8 @@ int ssp_calculate(struct intel_nhlt_params *nhlt) /* calculate blob for every hw config */ for (i = 0; i < ssp->ssp_hw_config_count[ssp->ssp_count]; i++) - ssp_calculate_intern(nhlt, i); + if (ssp_calculate_intern(nhlt, i) < 0) + return -EINVAL; ssp_print_internal(ssp); ssp_print_calculated(ssp); diff --git a/topology/pre-processor.c b/topology/pre-processor.c index c5b260c..dfe3ad6 100644 --- a/topology/pre-processor.c +++ b/topology/pre-processor.c @@ -98,7 +98,7 @@ static int run_plugin(struct tplg_pre_processor *tplg_pp, char *plugin) } /* process plugin */ - process(tplg_pp->input_cfg, tplg_pp->output_cfg); + ret = process(tplg_pp->input_cfg, tplg_pp->output_cfg); err: if (h) @@ -689,7 +689,7 @@ int pre_process(struct tplg_pre_processor *tplg_pp, char *config, size_t config_ /* process topology plugins */ err = pre_process_plugins(tplg_pp); if (err < 0) { - fprintf(stderr, "Unable to run pre-process plugins\n"); + fprintf(stderr, "Unable to run pre-process plugins or plugins return error\n"); goto err; } |