* dma/mv_xor: Fix a missing check in mv_xor_channel_add
@ 2018-12-24 17:41 Aditya Pakki
0 siblings, 0 replies; 2+ messages in thread
From: Aditya Pakki @ 2018-12-24 17:41 UTC (permalink / raw)
To: pakki001; +Cc: kjlu, Dan Williams, Vinod Koul, dmaengine, linux-kernel
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>
---
drivers/dma/mv_xor.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c
index 7f595355fb79..e733c5eeaabc 100644
--- a/drivers/dma/mv_xor.c
+++ b/drivers/dma/mv_xor.c
@@ -1153,7 +1153,10 @@ mv_xor_channel_add(struct mv_xor_device *xordev,
dma_has_cap(DMA_MEMCPY, dma_dev->cap_mask) ? "cpy " : "",
dma_has_cap(DMA_INTERRUPT, dma_dev->cap_mask) ? "intr " : "");
- dma_async_device_register(dma_dev);
+ ret = dma_async_device_register(dma_dev);
+ if (ret)
+ goto err_free_irq;
+
return mv_chan;
err_free_irq:
^ permalink raw reply related [flat|nested] 2+ messages in thread
* dma/mv_xor: Fix a missing check in mv_xor_channel_add
@ 2019-01-04 14:36 Vinod Koul
0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2019-01-04 14:36 UTC (permalink / raw)
To: Aditya Pakki; +Cc: kjlu, Dan Williams, dmaengine, linux-kernel
On 24-12-18, 11:41, Aditya Pakki wrote:
> 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.
Applied after fixing subsystem tag, thanks
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-01-04 14:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-04 14:36 dma/mv_xor: Fix a missing check in mv_xor_channel_add Vinod Koul
-- strict thread matches above, loose matches on Subject: below --
2018-12-24 17:41 Aditya Pakki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox