dsp: ion: avoid dma_buf_put twice when msm_audio_ion_map_buf fails
Update logic to avoid calling dma_buf_put twice when msm_audio_ion_map_buf fails. Change-Id: I6958ec55dc78f245e93fbaedf085873fe0f4cb93 Signed-off-by: Meng Wang <mengw@codeaurora.org>
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

parent
3944bb8d29
commit
b53d514f0d
@@ -582,17 +582,13 @@ int msm_audio_ion_alloc(struct dma_buf **dma_buf, size_t bufsz,
|
|||||||
rc = msm_audio_ion_map_buf(*dma_buf, paddr, plen, vaddr);
|
rc = msm_audio_ion_map_buf(*dma_buf, paddr, plen, vaddr);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
pr_err("%s: failed to map ION buf, rc = %d\n", __func__, rc);
|
pr_err("%s: failed to map ION buf, rc = %d\n", __func__, rc);
|
||||||
goto err_dma_buf;
|
goto err;
|
||||||
}
|
}
|
||||||
pr_debug("%s: mapped address = %pK, size=%zd\n", __func__,
|
pr_debug("%s: mapped address = %pK, size=%zd\n", __func__,
|
||||||
*vaddr, bufsz);
|
*vaddr, bufsz);
|
||||||
|
|
||||||
memset(*vaddr, 0, bufsz);
|
memset(*vaddr, 0, bufsz);
|
||||||
|
|
||||||
return rc;
|
|
||||||
|
|
||||||
err_dma_buf:
|
|
||||||
dma_buf_put(*dma_buf);
|
|
||||||
err:
|
err:
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user