]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: Remove erroneous soc_cleanup_card_resources() call
authorSylwester Nawrocki <s.nawrocki@samsung.com>
Fri, 7 Jun 2019 15:49:26 +0000 (17:49 +0200)
committerMark Brown <broonie@kernel.org>
Fri, 7 Jun 2019 16:03:35 +0000 (17:03 +0100)
commit6ade4270aea5c29b97e8166dfd0c5ae569d99b34
tree1cd6160866bc29020be6bcbb190afa4781be5736
parent41acc536e69361b297b47e8fa09ab29a7e65a580
ASoC: Remove erroneous soc_cleanup_card_resources() call

When soc_init_dai_link() call at the beginning of snd_soc_instantiate_card
function fails soc_cleanup_card_resources() and then snd_soc_dapm_free()
gets called with an incompletely initialized card->dapm. In particular
card->dapm.card is NULL and it gets dereferenced in dapm_free_widgets().
Also dapm->list is invalid and there is an invalid pointer dereference
from list_del().

The function call stack (deferred probing) on Chromebook Snow where this
issue has shown up in today's -next is:

 snd_soc_dapm_free
 soc_cleanup_card_resources
 snd_soc_instantiate_card
 snd_soc_register_card
 devm_snd_soc_register_card
 snow_probe

In patch 90f9fd46c1be "ASoC: core: move DAI pre-links initiation to
snd_soc_instantiate_card" there is an soc_cleanup_platform() call instead
of soc_cleanup_card_resources() as in current -next.

soc_cleanup_platform got renamed to soc_cleanup_legacy, then removed
in commit e433307ae681 "ASoC: soc-core: remove legacy style dai_link".

It seems in merge conflict resolution the soc_cleanup_platform() call got
renamed to soc_cleanup_card_resources(), instead of being removed.

Correct this by removing an unnecessary soc_cleanup_card_resources() call.

Fixes: b16e60a42f6e ("Merge branch 'asoc-5.2' into asoc-5.3")
Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
Suggested-by: Tzung-Bi Shih <tzungbi@google.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-core.c