aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/dma/mic_x100_dma.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/dma/mic_x100_dma.c b/drivers/dma/mic_x100_dma.c
index b76cb17d879c..adfd316db1a8 100644
--- a/drivers/dma/mic_x100_dma.c
+++ b/drivers/dma/mic_x100_dma.c
@@ -639,7 +639,7 @@ static struct mic_dma_device *mic_dma_dev_reg(struct mbus_device *mbdev,
639 int ret; 639 int ret;
640 struct device *dev = &mbdev->dev; 640 struct device *dev = &mbdev->dev;
641 641
642 mic_dma_dev = kzalloc(sizeof(*mic_dma_dev), GFP_KERNEL); 642 mic_dma_dev = devm_kzalloc(dev, sizeof(*mic_dma_dev), GFP_KERNEL);
643 if (!mic_dma_dev) { 643 if (!mic_dma_dev) {
644 ret = -ENOMEM; 644 ret = -ENOMEM;
645 goto alloc_error; 645 goto alloc_error;
@@ -664,7 +664,6 @@ static struct mic_dma_device *mic_dma_dev_reg(struct mbus_device *mbdev,
664reg_error: 664reg_error:
665 mic_dma_uninit(mic_dma_dev); 665 mic_dma_uninit(mic_dma_dev);
666init_error: 666init_error:
667 kfree(mic_dma_dev);
668 mic_dma_dev = NULL; 667 mic_dma_dev = NULL;
669alloc_error: 668alloc_error:
670 dev_err(dev, "Error at %s %d ret=%d\n", __func__, __LINE__, ret); 669 dev_err(dev, "Error at %s %d ret=%d\n", __func__, __LINE__, ret);
@@ -674,7 +673,6 @@ alloc_error:
674static void mic_dma_dev_unreg(struct mic_dma_device *mic_dma_dev) 673static void mic_dma_dev_unreg(struct mic_dma_device *mic_dma_dev)
675{ 674{
676 mic_dma_uninit(mic_dma_dev); 675 mic_dma_uninit(mic_dma_dev);
677 kfree(mic_dma_dev);
678} 676}
679 677
680/* DEBUGFS CODE */ 678/* DEBUGFS CODE */