1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

gnrc_pktbuf: assert that user count does not exceed 255

This commit is contained in:
Benjamin Valentin 2024-11-15 16:41:42 +01:00
parent db2f3bd3dd
commit e8b3b4d3e4
2 changed files with 2 additions and 0 deletions

View File

@ -210,6 +210,7 @@ void gnrc_pktbuf_hold(gnrc_pktsnip_t *pkt, unsigned int num)
{
mutex_lock(&gnrc_pktbuf_mutex);
while (pkt) {
assert(pkt->users + num <= 0xff);
pkt->users += num;
pkt = pkt->next;
}

View File

@ -213,6 +213,7 @@ void gnrc_pktbuf_hold(gnrc_pktsnip_t *pkt, unsigned int num)
{
mutex_lock(&gnrc_pktbuf_mutex);
while (pkt) {
assert(pkt->users + num <= 0xff);
pkt->users += num;
pkt = pkt->next;
}