]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
ASoC: SOF: Intel: unregister DMIC device on probe error
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Tue, 2 Mar 2021 00:34:10 +0000 (18:34 -0600)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 8 Apr 2021 20:42:11 +0000 (15:42 -0500)
BugLink: https://bugs.launchpad.net/bugs/1921712
commit 5bb0ecddb2a7f638d65e457f3da9fa334c967b14 upstream.

We only unregister the platform device during the .remove operation,
but if the probe fails we will never reach this sequence.

Suggested-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Fixes: dd96daca6c83e ("ASoC: SOF: Intel: Add APL/CNL HW DSP support")
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20210302003410.1178535-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
sound/soc/sof/intel/hda.c

index 509a9b25642301bd4d8af17c8a11646e3c0bdfc3..de6bc501f1b5fc8183a4a6ee1b5ddb09d5fed1ba 100644 (file)
@@ -896,6 +896,7 @@ free_streams:
 /* dsp_unmap: not currently used */
        iounmap(sdev->bar[HDA_DSP_BAR]);
 hdac_bus_unmap:
+       platform_device_unregister(hdev->dmic_dev);
        iounmap(bus->remap_addr);
        hda_codec_i915_exit(sdev);
 err: