CSMA: Assert that n and q are non-NULL in csma-output.c#packet_sent

This commit is contained in:
kkrentz 2018-11-07 03:06:50 -08:00
parent f71db7cc90
commit 0c0d7b3e46

View File

@ -49,6 +49,7 @@
#include "net/netstack.h" #include "net/netstack.h"
#include "lib/list.h" #include "lib/list.h"
#include "lib/memb.h" #include "lib/memb.h"
#include "lib/assert.h"
/* Log configuration */ /* Log configuration */
#include "sys/log.h" #include "sys/log.h"
@ -396,6 +397,9 @@ packet_sent(struct neighbor_queue *n,
int status, int status,
int num_transmissions) int num_transmissions)
{ {
assert(n != NULL);
assert(q != NULL);
if(q->ptr == NULL) { if(q->ptr == NULL) {
LOG_WARN("packet sent: no metadata\n"); LOG_WARN("packet sent: no metadata\n");
return; return;