diff --git a/sys/net/gnrc/link_layer/netdev2/gnrc_netdev2_ieee802154.c b/sys/net/gnrc/link_layer/netdev2/gnrc_netdev2_ieee802154.c index dc44156511fd0d6cafad3cafb7200feb9996fd86..311726dfe2faed25d7a77aeaf52752ce8bf4ca5c 100644 --- a/sys/net/gnrc/link_layer/netdev2/gnrc_netdev2_ieee802154.c +++ b/sys/net/gnrc/link_layer/netdev2/gnrc_netdev2_ieee802154.c @@ -191,7 +191,6 @@ static int _send(gnrc_netdev2_t *gnrc_netdev2, gnrc_pktsnip_t *pkt) } /* prepare packet for sending */ vec_snip = gnrc_pktbuf_get_iovec(pkt, &n); - res = -ENOBUFS; if (vec_snip != NULL) { struct iovec *vector; @@ -201,6 +200,9 @@ static int _send(gnrc_netdev2_t *gnrc_netdev2, gnrc_pktsnip_t *pkt) vector[0].iov_len = (size_t)res; res = netdev->driver->send(netdev, vector, n); } + else { + return -ENOBUFS; + } /* release old data */ gnrc_pktbuf_release(pkt); return res;