]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: wcd9335: Remove RX channel from old list before adding it to a new one
authorYassine Oudjana <y.oudjana@protonmail.com>
Mon, 6 Jun 2022 15:22:26 +0000 (19:22 +0400)
committerMark Brown <broonie@kernel.org>
Mon, 13 Jun 2022 12:27:55 +0000 (13:27 +0100)
commit5d6e7da212004e0862413e76ea549c6995629f41
tree003c7815da71e71788a9e8ba3081b8c4e5617128
parentcf527023e9b2bf71ffe50c7550aab7d64a6dbe1d
ASoC: wcd9335: Remove RX channel from old list before adding it to a new one

Currently in slim_rx_mux_put, an RX channel gets added to a new list
even if it is already in one. This can mess up links and make either
it, the new list head, or both, get linked to the wrong entries.
This can cause an entry to link to itself which in turn ends up
making list_for_each_entry in other functions loop infinitely.
To avoid issues, always remove the RX channel from any list it's in
before adding it to a new list.

Signed-off-by: Yassine Oudjana <y.oudjana@protonmail.com>
Link: https://lore.kernel.org/r/20220606152226.149164-1-y.oudjana@protonmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/wcd9335.c