From fa524fabd7a0315174682acb6d06d6d98d51d85a Mon Sep 17 00:00:00 2001 From: adamdunkels Date: Tue, 25 Jan 2011 14:24:38 +0000 Subject: [PATCH] Bugfix: q->buf was not tested for NULL, as it should be. Fix by Simon Duquennoy. --- core/net/mac/csma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/net/mac/csma.c b/core/net/mac/csma.c index 2a14b905a..6a82e3717 100644 --- a/core/net/mac/csma.c +++ b/core/net/mac/csma.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: csma.c,v 1.26 2011/01/18 16:03:57 adamdunkels Exp $ + * $Id: csma.c,v 1.27 2011/01/25 14:24:38 adamdunkels Exp $ */ /** @@ -277,7 +277,7 @@ send_packet(mac_callback_t sent, void *ptr) q = memb_alloc(&packet_memb); if(q != NULL) { q->buf = queuebuf_new_from_packetbuf(); - if(q != NULL) { + if(q->buf != NULL) { if(packetbuf_attr(PACKETBUF_ATTR_MAX_MAC_TRANSMISSIONS) == 0) { /* Use default configuration for max transmissions */ q->max_transmissions = CSMA_MAX_MAC_TRANSMISSIONS;