1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

gnrc_pktbuf_static: allow write-protect of size 0 snips

Size 0 snips are legal packet snips (empty payload e.g.) so it doesn't
make sense to issue an error in the write-protection in that case.

API documentation doesn't mention it either and the tests still pass
with the check removed.
This commit is contained in:
Martine Lenders 2019-03-12 14:34:19 +01:00
parent f7cdbdaab0
commit efb658a67c

View File

@ -249,7 +249,7 @@ void gnrc_pktbuf_release_error(gnrc_pktsnip_t *pkt, uint32_t err)
gnrc_pktsnip_t *gnrc_pktbuf_start_write(gnrc_pktsnip_t *pkt)
{
mutex_lock(&_mutex);
if ((pkt == NULL) || (pkt->size == 0)) {
if (pkt == NULL) {
mutex_unlock(&_mutex);
return NULL;
}