dma: mv_xor: Fix incorrect error path
authorSachin Kamat <sachin.kamat@linaro.org>
Mon, 2 Sep 2013 08:24:20 +0000 (13:54 +0530)
committerDan Williams <dan.j.williams@intel.com>
Mon, 9 Sep 2013 17:26:04 +0000 (10:26 -0700)
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>
drivers/dma/mv_xor.c

index d332b9e3f9ce9f4c0fdac9eec0020a6a8a2c83d7..0ec086d2b6a00819d2407108893d68e01a9063c2 100644 (file)
@@ -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;