In case of error returned by 'q6v5_xfer_mem_ownership', we must free
some resources before returning.
In 'q6v5_mpss_init_image()', add a new label to undo a previous
'dma_alloc_attrs()'.
In 'q6v5_mpss_load()', re-use the already existing error handling code to
undo a previous 'request_firmware()', as already done in the other error
handling paths of the function.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
if (ret) {
dev_err(qproc->dev,
"assigning Q6 access to metadata failed: %d\n", ret);
- return -EAGAIN;
+ ret = -EAGAIN;
+ goto free_dma_attrs;
}
writel(phys, qproc->rmb_base + RMB_PMI_META_DATA_REG);
dev_warn(qproc->dev,
"mdt buffer not reclaimed system may become unstable\n");
+free_dma_attrs:
dma_free_attrs(qproc->dev, fw->size, ptr, phys, dma_attrs);
return ret < 0 ? ret : 0;
if (ret) {
dev_err(qproc->dev,
"assigning Q6 access to mpss memory failed: %d\n", ret);
- return -EAGAIN;
+ ret = -EAGAIN;
+ goto release_firmware;
}
boot_addr = relocate ? qproc->mpss_phys : min_addr;