ASoC: Intel: Skylake: Fix to free dsp resource on ipc_init failure

For some dsp init error path, irq and few more resources are not freed.
This results in oops. So, fix it by freeing up the resources on ipc_init
failure.

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Acked-By: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Subhransu S. Prusty 2017-08-22 16:45:50 +05:30 committed by Mark Brown
parent 80b6490392
commit 3b3011adad
3 changed files with 9 additions and 3 deletions

View File

@ -582,8 +582,10 @@ int bxt_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq,
SKL_ADSP_W0_UP_SZ, BXT_ADSP_SRAM1_BASE, SKL_ADSP_W1_SZ); SKL_ADSP_W0_UP_SZ, BXT_ADSP_SRAM1_BASE, SKL_ADSP_W1_SZ);
ret = skl_ipc_init(dev, skl); ret = skl_ipc_init(dev, skl);
if (ret) if (ret) {
skl_dsp_free(sst);
return ret; return ret;
}
/* set the D0i3 check */ /* set the D0i3 check */
skl->ipc.ops.check_dsp_lp_on = skl_ipc_check_D0i0; skl->ipc.ops.check_dsp_lp_on = skl_ipc_check_D0i0;

View File

@ -450,8 +450,10 @@ int cnl_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq,
CNL_ADSP_W1_SZ); CNL_ADSP_W1_SZ);
ret = cnl_ipc_init(dev, cnl); ret = cnl_ipc_init(dev, cnl);
if (ret) if (ret) {
skl_dsp_free(sst);
return ret; return ret;
}
cnl->boot_complete = false; cnl->boot_complete = false;
init_waitqueue_head(&cnl->boot_wait); init_waitqueue_head(&cnl->boot_wait);

View File

@ -562,8 +562,10 @@ int skl_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq,
SKL_ADSP_W0_UP_SZ, SKL_ADSP_SRAM1_BASE, SKL_ADSP_W1_SZ); SKL_ADSP_W0_UP_SZ, SKL_ADSP_SRAM1_BASE, SKL_ADSP_W1_SZ);
ret = skl_ipc_init(dev, skl); ret = skl_ipc_init(dev, skl);
if (ret) if (ret) {
skl_dsp_free(sst);
return ret; return ret;
}
sst->fw_ops = skl_fw_ops; sst->fw_ops = skl_fw_ops;