This patch prevents errors when running tftpput.

Signed-off-by: Álvaro Fernández Rojas <[email protected]>
---
 drivers/dma/bcm6348-iudma.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/dma/bcm6348-iudma.c b/drivers/dma/bcm6348-iudma.c
index 1d3c192cfe..e7bd1b2350 100644
--- a/drivers/dma/bcm6348-iudma.c
+++ b/drivers/dma/bcm6348-iudma.c
@@ -324,6 +324,9 @@ static int bcm6348_iudma_receive(struct dma *dma, void 
**dst, void *metadata)
        struct bcm6348_dma_desc *dma_desc = dma_desc = ch_priv->dma_ring;
        int ret;
 
+       if (!ch_priv->running)
+               return -EINVAL;
+
        /* get dma ring descriptor address */
        dma_desc += ch_priv->desc_id;
 
@@ -369,6 +372,9 @@ static int bcm6348_iudma_send(struct dma *dma, void *src, 
size_t len,
        struct bcm6348_dma_desc *dma_desc;
        uint16_t status;
 
+       if (!ch_priv->running)
+                return -EINVAL;
+
        /* flush cache */
        bcm6348_iudma_fdc(src, len);
 
-- 
2.11.0

_______________________________________________
U-Boot mailing list
[email protected]
https://lists.denx.de/listinfo/u-boot

Reply via email to