mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
i2c: imx: fix i2c resource leak with dma transfer
In i2c_imx_dma_xfer(), when dmaengine_submit() returns error, the context goto label err_submit and then return. However, the memory allocated for txdesc has not been freed yet, which leads to resource leak. Signed-off-by: Gao Pan <[email protected]> Signed-off-by: Fugang Duan <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
This commit is contained in:
parent
a570a27af4
commit
c552815312
1 changed files with 1 additions and 0 deletions
|
|
@ -387,6 +387,7 @@ static int i2c_imx_dma_xfer(struct imx_i2c_struct *i2c_imx,
|
|||
return 0;
|
||||
|
||||
err_submit:
|
||||
dmaengine_terminate_all(dma->chan_using);
|
||||
err_desc:
|
||||
dma_unmap_single(chan_dev, dma->dma_buf,
|
||||
dma->dma_len, dma->dma_data_dir);
|
||||
|
|
|
|||
Loading…
Reference in a new issue