Skip to content

Commit

Permalink
dma: mv_xor: Fix incorrect error path
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sachin Kamat authored and Dan Williams committed Sep 9, 2013
1 parent e6a5fa6 commit a577659
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/dma/mv_xor.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a577659

Please sign in to comment.