diff options
-rw-r--r-- | drivers/dma/apbh_dma.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/dma/apbh_dma.c b/drivers/dma/apbh_dma.c index c63f4f6..c65a215 100644 --- a/drivers/dma/apbh_dma.c +++ b/drivers/dma/apbh_dma.c @@ -126,10 +126,10 @@ static int mxs_dma_enable(int channel) return 0; } - pdesc = list_first_entry(&pchan->active, struct mxs_dma_desc, node); - if (pdesc == NULL) + if (list_empty(&pchan->active)) return -EFAULT; - + + pdesc = list_first_entry(&pchan->active, struct mxs_dma_desc, node); if (pchan->flags & MXS_DMA_FLAGS_BUSY) { if (!(pdesc->cmd.data & MXS_DMA_DESC_CHAIN)) return 0; |