aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Aillet <jonathan.aillet@iot.bzh>2019-06-24 14:27:21 +0200
committerJonathan Aillet <jonathan.aillet@iot.bzh>2019-06-25 11:18:02 +0200
commitb04fa40a782d490aae4aefa1315a009051e26db6 (patch)
tree685c3e058aa27490ccc46c70120ae0464d866832
parent675c85ec8246780cd18a68151bcdb3e596794ee7 (diff)
Avoid unnecessary call for ALSA ctrl properties
Avoid getting ALSA control properties if the structure to store them is not allocated. BUG-AGL: SPEC-2329 Change-Id: If5fbacc7616250d8abf86f561f51a147868fea07 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
-rw-r--r--src/4a-internals-hal/4a-internals-hal-alsacore-link.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/4a-internals-hal/4a-internals-hal-alsacore-link.c b/src/4a-internals-hal/4a-internals-hal-alsacore-link.c
index 81e60f9..6cfdfba 100644
--- a/src/4a-internals-hal/4a-internals-hal-alsacore-link.c
+++ b/src/4a-internals-hal/4a-internals-hal-alsacore-link.c
@@ -291,14 +291,15 @@ int InternalHalUpdateAlsaCtlProperties(afb_api_t apiHandle, char *cardId, struct
json_object *returnedDataJ = NULL;
+ if(! currentAlsaCtl->alsaCtlProperties) {
+ AFB_API_ERROR(apiHandle, "Data structure to store alsa control properties is not allocated");
+ return -8;
+ }
+
err = InternalHalGetAlsaCtlInfo(apiHandle, cardId, currentAlsaCtl, &returnedDataJ);
if(err) {
return err;
}
- else if(! currentAlsaCtl->alsaCtlProperties) {
- AFB_API_ERROR(apiHandle, "Data structure to store alsa control properties is not allocated");
- err = -9;
- }
// TBD JAI : get dblinear/dbminmax/... values
else if(wrap_json_unpack(returnedDataJ,
"{s:i s:s s:{s?:i s?:i s?:i s?:i s?:i}}",