Skip to content

Commit

Permalink
Merge tag 'dmaengine-fix-4.19-rc4' of git://git.infradead.org/users/v…
Browse files Browse the repository at this point in the history
…koul/slave-dma

Pull dmaengine fix from Vinod Koul:
 "Fix the mic_x100_dma driver to use devm_kzalloc for driver memory, so
  that it is freed properly when it unregisters from dmaengine using
  managed API"

* tag 'dmaengine-fix-4.19-rc4' of git://git.infradead.org/users/vkoul/slave-dma:
  dmaengine: mic_x100_dma: use devm_kzalloc to fix an issue
  • Loading branch information
torvalds committed Sep 14, 2018
2 parents 1abc088 + 111b009 commit f3c0b8c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/dma/mic_x100_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ static struct mic_dma_device *mic_dma_dev_reg(struct mbus_device *mbdev,
int ret;
struct device *dev = &mbdev->dev;

mic_dma_dev = kzalloc(sizeof(*mic_dma_dev), GFP_KERNEL);
mic_dma_dev = devm_kzalloc(dev, sizeof(*mic_dma_dev), GFP_KERNEL);
if (!mic_dma_dev) {
ret = -ENOMEM;
goto alloc_error;
Expand All @@ -664,7 +664,6 @@ static struct mic_dma_device *mic_dma_dev_reg(struct mbus_device *mbdev,
reg_error:
mic_dma_uninit(mic_dma_dev);
init_error:
kfree(mic_dma_dev);
mic_dma_dev = NULL;
alloc_error:
dev_err(dev, "Error at %s %d ret=%d\n", __func__, __LINE__, ret);
Expand All @@ -674,7 +673,6 @@ static struct mic_dma_device *mic_dma_dev_reg(struct mbus_device *mbdev,
static void mic_dma_dev_unreg(struct mic_dma_device *mic_dma_dev)
{
mic_dma_uninit(mic_dma_dev);
kfree(mic_dma_dev);
}

/* DEBUGFS CODE */
Expand Down

0 comments on commit f3c0b8c

Please sign in to comment.