summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Hellstrom <daniel@gaisler.com>2018-08-13 11:36:03 +0200
committerDaniel Hellstrom <daniel@gaisler.com>2018-09-20 12:48:32 +0200
commit0aae151eba6dcfce5b6e74ea91c5da288a86d70d (patch)
tree4f9e1e766cd9740f02f97c5e480246963ea5d7db
parentleon, l2cache: workaround for scrubber (diff)
downloadrtems-0aae151eba6dcfce5b6e74ea91c5da288a86d70d.tar.bz2
leon,grspw_pkt: protect TX descriptor from bad input (hdrlen)
-rw-r--r--bsps/sparc/shared/spw/grspw_pkt.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/bsps/sparc/shared/spw/grspw_pkt.c b/bsps/sparc/shared/spw/grspw_pkt.c
index ff481f28a4..39f50876ed 100644
--- a/bsps/sparc/shared/spw/grspw_pkt.c
+++ b/bsps/sparc/shared/spw/grspw_pkt.c
@@ -1470,7 +1470,8 @@ STATIC int grspw_tx_schedule_send(struct grspw_dma_priv *dma)
curr_pkt->flags &= ~PKT_FLAG_TR_HDR;
}
BD_WRITE(&curr_bd->bd->haddr, hwaddr);
- ctrl = GRSPW_TXBD_EN | curr_pkt->hlen;
+ ctrl = GRSPW_TXBD_EN |
+ (curr_pkt->hlen & GRSPW_TXBD_HLEN);
} else {
ctrl = GRSPW_TXBD_EN;
}