]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: core: Make snd_soc_find_component() more robust
authorMark Brown <broonie@kernel.org>
Mon, 14 Jan 2019 23:29:36 +0000 (23:29 +0000)
committerMark Brown <broonie@kernel.org>
Tue, 15 Jan 2019 00:07:00 +0000 (00:07 +0000)
commite6d8df9542541a7b38a33142da8ff95c2cd528a7
tree75f005ea597a6b77e153fcc0ae40b0b8a5c3cfd8
parentbc834ed12d70602a1ee53ba49fbf65abf9762d42
ASoC: core: Make snd_soc_find_component() more robust

There are some use cases where you're checking for a lot of things on a
card and it makes sense that you might end up trying to call
snd_soc_find_component() without either a name or an of_node.  Currently
in that case we try to dereference the name and crash but it's more
useful to allow the caller to just treat that as a case where we don't
find anything, that error handling will already exist.

Inspired by a patch from Ajit Pandey fixing some callers.

Fixes: 0b9edc711fcb ("ASoC: soc-core: defer card probe until all component is added to list")
Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-core.c