diff options
author | Sachin Kamat <sachin.kamat@linaro.org> | 2013-09-02 04:24:20 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2013-09-09 13:26:04 -0400 |
commit | a577659f42f745b71cbc56c80fb1e801ec7e6348 (patch) | |
tree | 9d32260e8644af9fdb0c77b7542510e09b7e2466 | |
parent | e6a5fa63407bfc5b7b13e850a0a67e4db8c00ce7 (diff) |
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>
-rw-r--r-- | drivers/dma/mv_xor.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c index d332b9e3f9ce..0ec086d2b6a0 100644 --- a/drivers/dma/mv_xor.c +++ b/drivers/dma/mv_xor.c | |||
@@ -1036,10 +1036,8 @@ mv_xor_channel_add(struct mv_xor_device *xordev, | |||
1036 | struct dma_device *dma_dev; | 1036 | struct dma_device *dma_dev; |
1037 | 1037 | ||
1038 | mv_chan = devm_kzalloc(&pdev->dev, sizeof(*mv_chan), GFP_KERNEL); | 1038 | mv_chan = devm_kzalloc(&pdev->dev, sizeof(*mv_chan), GFP_KERNEL); |
1039 | if (!mv_chan) { | 1039 | if (!mv_chan) |
1040 | ret = -ENOMEM; | 1040 | return ERR_PTR(-ENOMEM); |
1041 | goto err_free_dma; | ||
1042 | } | ||
1043 | 1041 | ||
1044 | mv_chan->idx = idx; | 1042 | mv_chan->idx = idx; |
1045 | mv_chan->irq = irq; | 1043 | mv_chan->irq = irq; |