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:
parent
db2f3bd3dd
commit
e8b3b4d3e4
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user