Skip to content

Commit d0467a0

Browse files
author
Arto Kinnunen
authored
Fix stack overflow (ARMmbed#1718)
-Do not trace in interrupt context -Update buffer size trace in case of allocation failure
1 parent 7ea9001 commit d0467a0

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

source/Core/buffer_dyn.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ buffer_t *buffer_get_specific(uint16_t headroom, uint16_t size, uint16_t minspac
110110
#endif
111111
buf->size = total_size;
112112
} else {
113-
tr_error("buffer_get failed: alloc(%zd)", sizeof(buffer_t) + total_size);
113+
tr_error("buffer_get failed: alloc(%d)", sizeof(buffer_t) + total_size);
114114
}
115115

116116
protocol_stats_update(STATS_BUFFER_ALLOC, 1);

source/MAC/IEEE802_15_4/mac_pd_sap.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include "ns_types.h"
1919
#include "eventOS_event.h"
2020
#include "string.h"
21-
#include "ns_trace.h"
2221
#include "nsdynmemLIB.h"
2322
#include "randLIB.h"
2423
#include "ccmLIB.h"
@@ -36,9 +35,6 @@
3635
#include "MAC/IEEE802_15_4/mac_mcps_sap.h"
3736
#include "MAC/rf_driver_storage.h"
3837

39-
40-
#define TRACE_GROUP "mPDs"
41-
4238
/* Define TX Timeot Period */
4339
// Hardcoded to 1200ms. Should be changed dynamic: (FHSS) channel retries needs longer timeout
4440
#define NWKTX_TIMEOUT_PERIOD (1200*20)
@@ -336,7 +332,6 @@ int8_t mac_pd_sap_data_cb(void *identifier, arm_phy_sap_msg_t *message)
336332
mac_pre_parsed_frame_t *buffer = mcps_sap_pre_parsed_frame_buffer_get(pd_data_ind->data_ptr, pd_data_ind->data_len);
337333

338334
if (!buffer) {
339-
tr_error("pd_ind buffer get fail %u", pd_data_ind->data_len);
340335
sw_mac_stats_update(rf_ptr, STAT_MAC_RX_DROP, 0);
341336
return -3;
342337
}

0 commit comments

Comments
 (0)