[PATCH 05/44] leon, grspw_pkt: Fixed parameter check in grspw_dma_open()
Daniel Hellstrom
daniel at gaisler.com
Fri Mar 3 14:56:38 UTC 2017
From: Martin Aberg <maberg at gaisler.com>
---
c/src/lib/libbsp/sparc/shared/spw/grspw_pkt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/c/src/lib/libbsp/sparc/shared/spw/grspw_pkt.c b/c/src/lib/libbsp/sparc/shared/spw/grspw_pkt.c
index 037b63c..96348ae 100644
--- a/c/src/lib/libbsp/sparc/shared/spw/grspw_pkt.c
+++ b/c/src/lib/libbsp/sparc/shared/spw/grspw_pkt.c
@@ -1599,7 +1599,7 @@ void *grspw_dma_open(void *d, int chan_no)
struct grspw_dma_priv *dma;
int size;
- if ((chan_no < 0) && (priv->hwsup.ndma_chans <= chan_no))
+ if ((chan_no < 0) || (priv->hwsup.ndma_chans <= chan_no))
return NULL;
dma = &priv->dma[chan_no];
--
2.7.4
More information about the devel
mailing list