Commit fee50359 authored by Federico Vaga's avatar Federico Vaga

drv: be sure to have a DMA transfer descriptor

It happened at least once that we got an invalid tx pointer. Not sure
why this happened (e.g. spurious interrupt?), but it happened. With this
patch, we do not prevent this from happening, but we avoid to have a
kernel crash.

This could help to understand the real problem.
Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent 210eb054
......@@ -708,6 +708,10 @@ static irqreturn_t gn412x_dma_irq_handler(int irq, void *arg)
state = gn412x_dma_state(gn412x_dma);
gn412x_dma_schedule_next(chan);
if (WARN(!tx, "Invalid transfer descriptor\n"))
goto out;
switch (state) {
case GN412X_DMA_STAT_IDLE:
dma_cookie_complete(&tx->tx);
......@@ -740,7 +744,7 @@ static irqreturn_t gn412x_dma_irq_handler(int irq, void *arg)
state);
break;
}
out:
/* Clean up memory */
gn412x_dma_tx_free(tx);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment