]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: codecs: wcd934x: handle channel mappping list correctly
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tue, 30 Nov 2021 16:05:04 +0000 (16:05 +0000)
committerMark Brown <broonie@kernel.org>
Wed, 1 Dec 2021 14:13:49 +0000 (14:13 +0000)
commite67aaa9fbeb9ecb65f4fb48dc1e0bd1c69fd1dcc
tree0ba0998a53607339c9b53cc1aa4c85b976b175a9
parentde070a9a23ae1fe1ce02c9d0e1866036eab6c2ee
ASoC: codecs: wcd934x: handle channel mappping list correctly

Currently each channel is added as list to dai channel list, however
there is danger of adding same channel to multiple dai channel list
which endups corrupting the other list where its already added.

This patch ensures that the channel is actually free before adding to
the dai channel list and also ensures that the channel is on the list
before deleting it.

This check was missing previously, and we did not hit this issue as
we were testing very simple usecases with sequence of amixer commands.

Fixes: 73e4eab85ac5 ("ASoC: wcd934x: add capture dapm widgets")
Fixes: c93d475be70e ("ASoC: wcd934x: add playback dapm widgets")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20211130160507.22180-2-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/wcd934x.c