Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7ca42f5a authored by Guneshwor Singh's avatar Guneshwor Singh Committed by Mark Brown
Browse files

ASoC: Intel: Skylake: Fix mcps freeup after module unbind failure



While cleaning resources on module pmd event, we check for return
of skl_unbind_modules(). On failure this causes leak as all modules
attached do not have resources freed.

So ignore return value of module unbind and continue freeing
resources. This makes dapm state and resources correct.

Signed-off-by: default avatarGuneshwor Singh <guneshwor.o.singh@intel.com>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent ee564d48
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -98,7 +98,7 @@ static bool skl_tplg_alloc_pipe_mcps(struct skl *skl,
			"%s: module_id %d instance %d\n", __func__,
			mconfig->id.module_id, mconfig->id.instance_id);
		dev_err(ctx->dev,
			"exceeds ppl memory available %d > mem %d\n",
			"exceeds ppl mcps available %d > mem %d\n",
			skl->resource.max_mcps, skl->resource.mcps);
		return false;
	}
@@ -773,10 +773,7 @@ static int skl_tplg_mixer_dapm_post_pmd_event(struct snd_soc_dapm_widget *w,
			continue;
		}

		ret = skl_unbind_modules(ctx, src_module, dst_module);
		if (ret < 0)
			return ret;

		skl_unbind_modules(ctx, src_module, dst_module);
		src_module = dst_module;
	}