diff options
author | Álvaro Fernández Rojas <noltari@gmail.com> | 2019-03-22 18:22:31 +0100 |
---|---|---|
committer | Daniel Schwierzeck <daniel.schwierzeck@gmail.com> | 2019-04-12 17:32:50 +0200 |
commit | e4f907e968a754fd1180c364c90ba2a4a0398d7e (patch) | |
tree | b59345a9c6e7bca5bb4303c7b251a2930187241d /drivers/dma | |
parent | cd424f35ee37c105c6d32fa3b06cd49178af0840 (diff) |
dma: bcm6348: check if driver is enabled before send/recv
This patch prevents errors when running tftpput.
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Diffstat (limited to 'drivers/dma')
-rw-r--r-- | drivers/dma/bcm6348-iudma.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/dma/bcm6348-iudma.c b/drivers/dma/bcm6348-iudma.c index 1d3c192cfe5..e7bd1b2350f 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); |