From e427c419f5fb58af15259117475cf8fa66a60de2 Mon Sep 17 00:00:00 2001 From: Vidyakumar Athota Date: Sat, 16 Jun 2018 00:02:46 -0700 Subject: [PATCH] dsp: fix return code check in adm driver Return error only if apr_send_pkt() function return code is less than 0. Change-Id: I98903c6c275f360d32c3af523352071d92d1ef85 Signed-off-by: Vidyakumar Athota --- dsp/q6adm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dsp/q6adm.c b/dsp/q6adm.c index 7d59fbbce66a..e38ab41d0bb8 100644 --- a/dsp/q6adm.c +++ b/dsp/q6adm.c @@ -984,7 +984,7 @@ int adm_get_pp_params(int port_id, int copp_idx, uint32_t client_id, copp_stat = &this_adm.copp.stat[port_idx][copp_idx]; atomic_set(copp_stat, -1); ret = apr_send_pkt(this_adm.apr, (uint32_t *) &adm_get_params); - if (ret) { + if (ret < 0) { pr_err("%s: Get params APR send failed port = 0x%x ret %d\n", __func__, port_id, ret); ret = -EINVAL; @@ -1100,7 +1100,7 @@ int adm_get_pp_topo_module_list_v2(int port_id, int copp_idx, copp_stat = &this_adm.copp.stat[port_idx][copp_idx]; atomic_set(copp_stat, -1); ret = apr_send_pkt(this_adm.apr, (uint32_t *) &adm_get_module_list); - if (ret) { + if (ret < 0) { pr_err("%s: APR send pkt failed for port_id: 0x%x failed ret %d\n", __func__, port_id, ret); ret = -EINVAL;