Merge pull request #11186 from gschorcht/cpu/esp32/esp_eth/iol_len

cpu/esp32: esp_eth doesn't call memcpy if iol_len is 0
This commit is contained in:
Martine Lenders 2019-04-02 17:51:26 +02:00 committed by GitHub
commit 2d906de873
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -200,8 +200,10 @@ static int _esp_eth_send(netdev_t *netdev, const iolist_t *iolist)
mutex_unlock(&dev->dev_lock);
return -EOVERFLOW;
}
memcpy (dev->tx_buf + dev->tx_len, iol->iol_base, iol->iol_len);
dev->tx_len += iol->iol_len;
if (iol->iol_len) {
memcpy (dev->tx_buf + dev->tx_len, iol->iol_base, iol->iol_len);
dev->tx_len += iol->iol_len;
}
}
#if ENABLE_DEBUG