mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
Merge pull request #11321 from bergzand/pr/mrf24j40/fix_empty_element
drivers/mrf24j40: don't load data if iol->iol_len == 0
This commit is contained in:
commit
d77b8e1f52
@ -71,13 +71,17 @@ static int _send(netdev_t *netdev, const iolist_t *iolist)
|
||||
|
||||
/* load packet data into FIFO */
|
||||
for (const iolist_t *iol = iolist; iol; iol = iol->iol_next) {
|
||||
/* current packet data + FCS too long */
|
||||
if ((len + iol->iol_len + 2) > IEEE802154_FRAME_LEN_MAX) {
|
||||
DEBUG("[mrf24j40] error: packet too large (%u byte) to be send\n",
|
||||
(unsigned)len + 2);
|
||||
return -EOVERFLOW;
|
||||
/* Check if there is data to copy, prevents assertion failure in the
|
||||
* SPI peripheral if there is no data to copy */
|
||||
if (iol->iol_len) {
|
||||
/* current packet data + FCS too long */
|
||||
if ((len + iol->iol_len + 2) > IEEE802154_FRAME_LEN_MAX) {
|
||||
DEBUG("[mrf24j40] error: packet too large (%u byte) to be send\n",
|
||||
(unsigned)len + 2);
|
||||
return -EOVERFLOW;
|
||||
}
|
||||
len = mrf24j40_tx_load(dev, iol->iol_base, iol->iol_len, len);
|
||||
}
|
||||
len = mrf24j40_tx_load(dev, iol->iol_base, iol->iol_len, len);
|
||||
/* only on first iteration: */
|
||||
if (iol == iolist) {
|
||||
dev->header_len = len;
|
||||
|
Loading…
Reference in New Issue
Block a user