]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/dma/at_xdmac.c
drm/i915/execlists: Refactor -EIO markup of hung requests
[linux.git] / drivers / dma / at_xdmac.c
index 627ef3e5b3127f77f42b90e622d5782565e18b2c..b58ac720d9a122099dd6f9c7e60f28cc215dc0dc 100644 (file)
@@ -1568,11 +1568,14 @@ static void at_xdmac_handle_cyclic(struct at_xdmac_chan *atchan)
        struct at_xdmac_desc            *desc;
        struct dma_async_tx_descriptor  *txd;
 
-       desc = list_first_entry(&atchan->xfers_list, struct at_xdmac_desc, xfer_node);
-       txd = &desc->tx_dma_desc;
+       if (!list_empty(&atchan->xfers_list)) {
+               desc = list_first_entry(&atchan->xfers_list,
+                                       struct at_xdmac_desc, xfer_node);
+               txd = &desc->tx_dma_desc;
 
-       if (txd->flags & DMA_PREP_INTERRUPT)
-               dmaengine_desc_get_callback_invoke(txd, NULL);
+               if (txd->flags & DMA_PREP_INTERRUPT)
+                       dmaengine_desc_get_callback_invoke(txd, NULL);
+       }
 }
 
 static void at_xdmac_handle_error(struct at_xdmac_chan *atchan)