Commit f3c0b8ce authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'dmaengine-fix-4.19-rc4' of git://git.infradead.org/users/vkoul/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
parents 1abc088a 111b009f
...@@ -639,7 +639,7 @@ static struct mic_dma_device *mic_dma_dev_reg(struct mbus_device *mbdev, ...@@ -639,7 +639,7 @@ static struct mic_dma_device *mic_dma_dev_reg(struct mbus_device *mbdev,
int ret; int ret;
struct device *dev = &mbdev->dev; 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) { if (!mic_dma_dev) {
ret = -ENOMEM; ret = -ENOMEM;
goto alloc_error; goto alloc_error;
...@@ -664,7 +664,6 @@ static struct mic_dma_device *mic_dma_dev_reg(struct mbus_device *mbdev, ...@@ -664,7 +664,6 @@ static struct mic_dma_device *mic_dma_dev_reg(struct mbus_device *mbdev,
reg_error: reg_error:
mic_dma_uninit(mic_dma_dev); mic_dma_uninit(mic_dma_dev);
init_error: init_error:
kfree(mic_dma_dev);
mic_dma_dev = NULL; mic_dma_dev = NULL;
alloc_error: alloc_error:
dev_err(dev, "Error at %s %d ret=%d\n", __func__, __LINE__, ret); dev_err(dev, "Error at %s %d ret=%d\n", __func__, __LINE__, ret);
...@@ -674,7 +673,6 @@ static struct mic_dma_device *mic_dma_dev_reg(struct mbus_device *mbdev, ...@@ -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) static void mic_dma_dev_unreg(struct mic_dma_device *mic_dma_dev)
{ {
mic_dma_uninit(mic_dma_dev); mic_dma_uninit(mic_dma_dev);
kfree(mic_dma_dev);
} }
/* DEBUGFS CODE */ /* DEBUGFS CODE */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment