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:
parent
f7cdbdaab0
commit
efb658a67c
@ -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)
|
gnrc_pktsnip_t *gnrc_pktbuf_start_write(gnrc_pktsnip_t *pkt)
|
||||||
{
|
{
|
||||||
mutex_lock(&_mutex);
|
mutex_lock(&_mutex);
|
||||||
if ((pkt == NULL) || (pkt->size == 0)) {
|
if (pkt == NULL) {
|
||||||
mutex_unlock(&_mutex);
|
mutex_unlock(&_mutex);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user