diff options
author | Chaithanya Krishna Bacharaju <chaithan@codeaurora.org> | 2015-04-09 16:26:36 +0530 |
---|---|---|
committer | Chaithanya Krishna Bacharaju <chaithan@codeaurora.org> | 2015-04-09 16:27:54 +0530 |
commit | b9bf50f6d1e68dc1326ba9090e9d3ad4b96c42ce (patch) | |
tree | ce8b2d97c9e50053e63ac5cb9ca9e16d22c1fa18 /post_proc/effect_api.c | |
parent | 16b2dd39c49de253e5d9d774ca44ce8ebe44d903 (diff) | |
download | hardware_qcom_audio-b9bf50f6d1e68dc1326ba9090e9d3ad4b96c42ce.tar.gz hardware_qcom_audio-b9bf50f6d1e68dc1326ba9090e9d3ad4b96c42ce.tar.bz2 hardware_qcom_audio-b9bf50f6d1e68dc1326ba9090e9d3ad4b96c42ce.zip |
post_proc: Fix for KW reported P1 issues
-Changes are made to address P1 issues reported by KW:
160375, 160376
Change-Id: I4ac3573142f68b0bbe0de162b3883f8a9484fe5e
Diffstat (limited to 'post_proc/effect_api.c')
-rw-r--r-- | post_proc/effect_api.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/post_proc/effect_api.c b/post_proc/effect_api.c index 7c1968e4..63ce2c23 100644 --- a/post_proc/effect_api.c +++ b/post_proc/effect_api.c @@ -114,7 +114,7 @@ int offload_update_mixer_and_effects_ctl(int card, int device_id, return -EINVAL; } else { *ctl = mixer_get_ctl_by_name(*mixer, mixer_string); - if (!ctl) { + if (!(*ctl)) { ALOGE("mixer_get_ctl_by_name failed"); mixer_close(*mixer); *mixer = NULL; @@ -891,6 +891,11 @@ static int hpx_send_params(eff_mode_t mode, void *ctl, uint32_t i; ALOGV("%s", __func__); + if (!ctl) { + ALOGE("%s: ctl is NULL, return invalid", __func__); + return -EINVAL; + } + if (param_send_flags & OFFLOAD_SEND_HPX_STATE_OFF) { *p_param_values++ = DTS_EAGLE_MODULE_ENABLE; *p_param_values++ = 0; /* hpx off*/ @@ -899,7 +904,7 @@ static int hpx_send_params(eff_mode_t mode, void *ctl, *p_param_values++ = 1; /* hpx on*/ } - if ((mode == OFFLOAD) && ctl) + if (mode == OFFLOAD) mixer_ctl_set_array(ctl, param_values, ARRAY_SIZE(param_values)); else { if (ioctl(*(int *)ctl, AUDIO_EFFECTS_SET_PP_PARAMS, param_values) < 0) |