byt->dsp = sst_dsp_new(dev, &byt_dev, pdata);
if (byt->dsp == NULL) {
err = -ENODEV;
- goto err_free_msg;
+ goto dsp_err;
}
/* keep the DSP in reset state for base FW loading */
sst_fw_free(byt_sst_fw);
fw_err:
sst_dsp_free(byt->dsp);
+dsp_err:
+ kthread_stop(byt->tx_thread);
err_free_msg:
kfree(byt->msg);
sst_dsp_reset(byt->dsp);
sst_fw_free_all(byt->dsp);
sst_dsp_free(byt->dsp);
+ kthread_stop(byt->tx_thread);
kfree(byt->msg);
}
EXPORT_SYMBOL_GPL(sst_byt_dsp_free);
ret = msg_empty_list_init(hsw);
if (ret < 0)
- goto list_err;
+ return -ENOMEM;
/* start the IPC message thread */
init_kthread_worker(&hsw->kworker);
if (IS_ERR(hsw->tx_thread)) {
ret = PTR_ERR(hsw->tx_thread);
dev_err(hsw->dev, "error: failed to create message TX task\n");
- goto list_err;
+ goto err_free_msg;
}
init_kthread_work(&hsw->kwork, ipc_tx_msgs);
hsw->dsp = sst_dsp_new(dev, &hsw_dev, pdata);
if (hsw->dsp == NULL) {
ret = -ENODEV;
- goto list_err;
+ goto dsp_err;
}
/* keep the DSP in reset state for base FW loading */
sst_fw_free(hsw_sst_fw);
fw_err:
sst_dsp_free(hsw->dsp);
+dsp_err:
+ kthread_stop(hsw->tx_thread);
+err_free_msg:
kfree(hsw->msg);
-list_err:
+
return ret;
}
EXPORT_SYMBOL_GPL(sst_hsw_dsp_init);
sst_fw_free_all(hsw->dsp);
sst_dsp_free(hsw->dsp);
kfree(hsw->scratch);
+ kthread_stop(hsw->tx_thread);
kfree(hsw->msg);
}
EXPORT_SYMBOL_GPL(sst_hsw_dsp_free);