Skip to content

Commit 7c97381

Browse files
Aditya Pakkivinodkoul
authored andcommitted
dmaengine: mv_xor: Fix a missing check in mv_xor_channel_add
dma_async_device_register() may fail and return an error. The capabilities checked in mv_xor_channel_add() are not complete. The fix handles the error by freeing the resources. Signed-off-by: Aditya Pakki <pakki001@umn.edu> Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent bfeffd1 commit 7c97381

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/dma/mv_xor.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1153,7 +1153,10 @@ mv_xor_channel_add(struct mv_xor_device *xordev,
11531153
dma_has_cap(DMA_MEMCPY, dma_dev->cap_mask) ? "cpy " : "",
11541154
dma_has_cap(DMA_INTERRUPT, dma_dev->cap_mask) ? "intr " : "");
11551155

1156-
dma_async_device_register(dma_dev);
1156+
ret = dma_async_device_register(dma_dev);
1157+
if (ret)
1158+
goto err_free_irq;
1159+
11571160
return mv_chan;
11581161

11591162
err_free_irq:

0 commit comments

Comments
 (0)