Skip to content

Commit

Permalink
dmaengine: at_hdmac: add missing kfree() call in at_dma_xlate()
Browse files Browse the repository at this point in the history
If memory allocation for 'atslave' succeed, at_dma_xlate() doesn't have a
corresponding kfree() in exception handling. Thus add kfree() for this
function implementation.

Fixes: bbe89c8 ("at_hdmac: move to generic DMA binding")
Signed-off-by: Yu Kuai <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Vinod Koul <[email protected]>
  • Loading branch information
YuKuai-huawei authored and vinodkoul committed Aug 19, 2020
1 parent 3832b78 commit e097eb7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/dma/at_hdmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1691,6 +1691,7 @@ static struct dma_chan *at_dma_xlate(struct of_phandle_args *dma_spec,
chan = dma_request_channel(mask, at_dma_filter, atslave);
if (!chan) {
put_device(&dmac_pdev->dev);
kfree(atslave);
return NULL;
}

Expand Down

0 comments on commit e097eb7

Please sign in to comment.