summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/sparc/shared/spw/grspw_pkt.c
diff options
context:
space:
mode:
authorDaniel Hellstrom <daniel@gaisler.com>2016-04-12 13:53:42 +0200
committerDaniel Hellstrom <daniel@gaisler.com>2017-03-06 07:54:55 +0100
commitef94150f41909cd680473a7e2b2e36ca9c195c8c (patch)
treebd90bf43b48c66581480cc7b2e169e551d0a7f5c /c/src/lib/libbsp/sparc/shared/spw/grspw_pkt.c
parentleon, grspw_pkt: fix stscfg cfg TimeCode Int clr (diff)
downloadrtems-ef94150f41909cd680473a7e2b2e36ca9c195c8c.tar.bz2
leon, grspw_pkt: Added checks for special list cases
- Fixed grspw_dma_tx_send() so that it does not fail when an empty user packet is provided. - Added empty checks on some of the list handling inline functions for GRSPW_PKT. Their use by the driver may be correct already, but the user might not have been aware of the assumptions that certain lists had to be non-empty.
Diffstat (limited to 'c/src/lib/libbsp/sparc/shared/spw/grspw_pkt.c')
-rw-r--r--c/src/lib/libbsp/sparc/shared/spw/grspw_pkt.c4
1 files changed, 2 insertions, 2 deletions
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 5f40853ef8..cfeebe47b7 100644
--- a/c/src/lib/libbsp/sparc/shared/spw/grspw_pkt.c
+++ b/c/src/lib/libbsp/sparc/shared/spw/grspw_pkt.c
@@ -1841,7 +1841,7 @@ int grspw_dma_tx_send(void *c, int opts, struct grspw_list *pkts, int count)
grspw_tx_process_scheduled(dma);
/* 2. Add the requested packets to the SEND List (USER->SEND) */
- if (pkts) {
+ if (pkts && (count > 0)) {
grspw_list_append_list(&dma->send, pkts);
dma->send_cnt += count;
if (dma->stats.send_cnt_max < dma->send_cnt)
@@ -3104,7 +3104,7 @@ static int grspw_common_init(void)
if (rtems_task_start(grspw_work_task, grspw_work_func, 0) !=
RTEMS_SUCCESSFUL)
return -1;
- }
+}
grspw_initialized = 1;
return 0;