From: Jaroslav Kysela Date: Wed, 20 Jan 2021 15:58:33 +0000 (+0100) Subject: topology: fix 'parse_tuple_set() - remove dead condition code' X-Git-Tag: v1.2.5~115 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=ae7362c996e0b991c399cc26c6d0b3c8e295e83c;p=alsa-lib.git topology: fix 'parse_tuple_set() - remove dead condition code' The whole SND_SOC_TPLG_TUPLE_TYPE_WORD condition part must be commented out, otherwise the condition is always true. Fixes: 51e1d486ce ("topology: parse_tuple_set() - remove dead condition code") BugLink: https://github.com/alsa-project/alsa-lib/issues/114 Signed-off-by: Jaroslav Kysela --- diff --git a/src/topology/data.c b/src/topology/data.c index 5633cdc3..0546d63e 100644 --- a/src/topology/data.c +++ b/src/topology/data.c @@ -859,11 +859,11 @@ static int parse_tuple_set(snd_config_t *cfg, goto err; } - if ((type == SND_SOC_TPLG_TUPLE_TYPE_WORD - /* && tuple_val > UINT_MAX */) - || (type == SND_SOC_TPLG_TUPLE_TYPE_SHORT - && tuple_val > USHRT_MAX) - || (type == SND_SOC_TPLG_TUPLE_TYPE_BYTE + if (/* (type == SND_SOC_TPLG_TUPLE_TYPE_WORD + && tuple_val > UINT_MAX) || */ + (type == SND_SOC_TPLG_TUPLE_TYPE_SHORT + && tuple_val > USHRT_MAX) || + (type == SND_SOC_TPLG_TUPLE_TYPE_BYTE && tuple_val > UCHAR_MAX)) { SNDERR("tuple %s: invalid value", id); goto err;