]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: Intel: sof_sdw_rt711: remove properties in card remove
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Fri, 17 Jul 2020 21:13:33 +0000 (16:13 -0500)
committerMark Brown <broonie@kernel.org>
Mon, 20 Jul 2020 15:08:20 +0000 (16:08 +0100)
commit10398a3eb763ea6114a1a023b6f0f7bdf00d9794
treee62fe1102e44700b4a1848390dfdc2b1e5b2c5d0
parent28e8a34f6f01a81dfd6586831e9382a511b41f27
ASoC: Intel: sof_sdw_rt711: remove properties in card remove

The rt711 jack detection properties are set from the machine drivers
during the card probe, as done in other ASoC examples.

KASAN reports a use-after-free error when unbinding drivers due to a
confusing sequence between the ACPI core, the device core and the
SoundWire device cleanups.

Rather than fixing this sequence, follow the recommendation to have
the same caller add and remove properties, add an explicit
device_remove_properties() in the card .remove() callback.

In future patches the use of device_add/remove_properties will be
replaced by a direct handling of a swnode, but the sequence will
remain the same.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200717211337.31956-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/boards/sof_sdw.c
sound/soc/intel/boards/sof_sdw_common.h
sound/soc/intel/boards/sof_sdw_rt711.c