From fc8ccac5604c6c1e8b4c4079ced2dd9b15d8b7f8 Mon Sep 17 00:00:00 2001 From: Toshio Ito Date: Thu, 18 Oct 2018 16:05:45 +0900 Subject: [PATCH 1/2] tsch: report MAC_TX_ERR if prepare() fails Before this fix, uninitialized mac_tx_status was reported in this case. --- os/net/mac/tsch/tsch-slot-operation.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/os/net/mac/tsch/tsch-slot-operation.c b/os/net/mac/tsch/tsch-slot-operation.c index 841dee07f..5fbf86013 100644 --- a/os/net/mac/tsch/tsch-slot-operation.c +++ b/os/net/mac/tsch/tsch-slot-operation.c @@ -643,6 +643,8 @@ PT_THREAD(tsch_tx_slot(struct pt *pt, struct rtimer *t)) mac_tx_status = MAC_TX_ERR; } } + }else { + mac_tx_status = MAC_TX_ERR; } } From cb962855a46dba83537a9f89bb960c5bcdb79b88 Mon Sep 17 00:00:00 2001 From: Toshio Ito Date: Fri, 19 Oct 2018 22:32:52 +0900 Subject: [PATCH 2/2] fix code style for else --- os/net/mac/tsch/tsch-slot-operation.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/os/net/mac/tsch/tsch-slot-operation.c b/os/net/mac/tsch/tsch-slot-operation.c index 5fbf86013..a801bc92e 100644 --- a/os/net/mac/tsch/tsch-slot-operation.c +++ b/os/net/mac/tsch/tsch-slot-operation.c @@ -643,7 +643,7 @@ PT_THREAD(tsch_tx_slot(struct pt *pt, struct rtimer *t)) mac_tx_status = MAC_TX_ERR; } } - }else { + } else { mac_tx_status = MAC_TX_ERR; } }