Explorar o código

dma: mv_xor: Fix incorrect error path

Return directly if memory allocation fails. There is no need
of dma_free_coherent().

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Saeed Bishara <saeed@marvell.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Sachin Kamat %!s(int64=12) %!d(string=hai) anos
pai
achega
a577659f42
Modificáronse 1 ficheiros con 2 adicións e 4 borrados
  1. 2 4
      drivers/dma/mv_xor.c

+ 2 - 4
drivers/dma/mv_xor.c

@@ -1036,10 +1036,8 @@ mv_xor_channel_add(struct mv_xor_device *xordev,
 	struct dma_device *dma_dev;
 
 	mv_chan = devm_kzalloc(&pdev->dev, sizeof(*mv_chan), GFP_KERNEL);
-	if (!mv_chan) {
-		ret = -ENOMEM;
-		goto err_free_dma;
-	}
+	if (!mv_chan)
+		return ERR_PTR(-ENOMEM);
 
 	mv_chan->idx = idx;
 	mv_chan->irq = irq;