From deaa1635cc284ab7e7083b9ce7d25a49fd653626 Mon Sep 17 00:00:00 2001 From: Chao Song Date: Thu, 8 Dec 2022 14:40:04 +0800 Subject: [PATCH] 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 Signed-off-by: Jaroslav Kysela --- topology/nhlt/intel/ssp/ssp-process.c | 3 ++- 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; }