projects
/
sdk
/
emulator
/
emulator-kernel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d496b66
)
ASoC: codecs: wcd938x-sdw: fix use after free on driver unbind
author
Johan Hovold
<johan+linaro@kernel.org>
Tue, 3 Oct 2023 15:55:57 +0000
(17:55 +0200)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Wed, 25 Oct 2023 10:03:05 +0000
(12:03 +0200)
commit
f0dfdcbe706462495d47982eecd13a61aabd644d
upstream.
Make sure to deregister the component when the driver is being unbound
and before the underlying device-managed resources are freed.
Fixes: 16572522aece ("ASoC: codecs: wcd938x-sdw: add SoundWire driver")
Cc: stable@vger.kernel.org # 5.14
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Link:
https://lore.kernel.org/r/20231003155558.27079-7-johan+linaro@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/soc/codecs/wcd938x-sdw.c
patch
|
blob
|
history
diff --git
a/sound/soc/codecs/wcd938x-sdw.c
b/sound/soc/codecs/wcd938x-sdw.c
index 9c10200ff34b2f924b0541ac0e139fd4eb264d7a..7bec013cfa7304f56779d1e9584ee5f7e1a41a82 100644
(file)
--- a/
sound/soc/codecs/wcd938x-sdw.c
+++ b/
sound/soc/codecs/wcd938x-sdw.c
@@
-1281,6
+1281,15
@@
static int wcd9380_probe(struct sdw_slave *pdev,
return component_add(dev, &wcd938x_sdw_component_ops);
}
+static int wcd9380_remove(struct sdw_slave *pdev)
+{
+ struct device *dev = &pdev->dev;
+
+ component_del(dev, &wcd938x_sdw_component_ops);
+
+ return 0;
+}
+
static const struct sdw_device_id wcd9380_slave_id[] = {
SDW_SLAVE_ENTRY(0x0217, 0x10d, 0),
{},
@@
-1320,6
+1329,7
@@
static const struct dev_pm_ops wcd938x_sdw_pm_ops = {
static struct sdw_driver wcd9380_codec_driver = {
.probe = wcd9380_probe,
+ .remove = wcd9380_remove,
.ops = &wcd9380_slave_ops,
.id_table = wcd9380_slave_id,
.driver = {