]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: SOF: core: fix error handling with the probe workqueue
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Fri, 24 May 2019 19:09:19 +0000 (14:09 -0500)
committerMark Brown <broonie@kernel.org>
Tue, 28 May 2019 14:47:19 +0000 (15:47 +0100)
commit290b7d18bda2bcc6ff13c5b59c9450fd4d39120d
tree5d55c9a62c7bbdaac8ae6fee80fb62e704f30cb7
parenta5622ee2e85502e59797683fb84f87d70926ca0e
ASoC: SOF: core: fix error handling with the probe workqueue

In some configurations, it's a requirement to split the probe in two,
with a second part handled in a workqueue (e.g. for HDMI support
which depends on the DRM modules).

SOF already handles these configurations but the error flow is
incorrect. When an error occurs in the workqueue, the probe has
technically already completed. If we release the resources on errors,
this generates kernel oops/use-after-free when the resources are
released a second time on module removal.

GitHub issue: https://github.com/thesofproject/linux/issues/945
Fixes: 0aafc1dc38e ("ASoC: SOF: Add Sound Open Firmware driver core")
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/core.c