Skip to content
Unverified Commit 58f01c7f authored by Tom Rix's avatar Tom Rix Committed by Mark Brown
Browse files

ASoC: codecs: lpass-wsa-macro: handle unexpected input



Static analysis reports this problem

lpass-wsa-macro.c:1732:6: warning: Array subscript is undefined
        if (wsa->ec_hq[ec_tx]) {
            ^~~~~~~~~~~~~~~~~

The happens because 'ec_tx' is never initialized and there is
no default in switch statement that sets ec_tx.  Add a default
case that returns an error before the array is accessed.

Signed-off-by: default avatarTom Rix <trix@redhat.com>
Reviewed-by: default avatarSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20210430142117.3272772-1-trix@redhat.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 1d122dd3
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment