summaryrefslogtreecommitdiff
path: root/sound/soc/intel/skylake/skl-pcm.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2017-04-14 22:11:20 +0300
committerMark Brown <broonie@kernel.org>2017-04-21 18:00:33 +0100
commit550b349af0f0e33fedb252aca8dc144299aca308 (patch)
tree0ec67c4d491d0a5cc30f185559e5a506cb2574de /sound/soc/intel/skylake/skl-pcm.c
parente6a33532affd14c12688c0e9b2e773e8b2550f3b (diff)
ASoC: Intel: Skylake: Fix a couple user after free bugs
We need to use the _safe() version of list_for_each_entry() here because of the kfree(modules). Fixes: b8c722ddd548 ("ASoC: Intel: Skylake: Add support for deferred DSP module bind") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/intel/skylake/skl-pcm.c')
-rw-r--r--sound/soc/intel/skylake/skl-pcm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/soc/intel/skylake/skl-pcm.c b/sound/soc/intel/skylake/skl-pcm.c
index 600faad19bd4..d43d1976dd3b 100644
--- a/sound/soc/intel/skylake/skl-pcm.c
+++ b/sound/soc/intel/skylake/skl-pcm.c
@@ -1323,10 +1323,10 @@ int skl_platform_unregister(struct device *dev)
{
struct hdac_ext_bus *ebus = dev_get_drvdata(dev);
struct skl *skl = ebus_to_skl(ebus);
- struct skl_module_deferred_bind *modules;
+ struct skl_module_deferred_bind *modules, *tmp;
if (!list_empty(&skl->bind_list)) {
- list_for_each_entry(modules, &skl->bind_list, node) {
+ list_for_each_entry_safe(modules, tmp, &skl->bind_list, node) {
list_del(&modules->node);
kfree(modules);
}