diff --git a/source/MAC/IEEE802_15_4/mac_mcps_sap.c b/source/MAC/IEEE802_15_4/mac_mcps_sap.c index 1214ff3dbf9..11afe47c89d 100644 --- a/source/MAC/IEEE802_15_4/mac_mcps_sap.c +++ b/source/MAC/IEEE802_15_4/mac_mcps_sap.c @@ -154,7 +154,10 @@ void mcps_sap_data_req_handler(protocol_interface_rf_mac_setup_s *rf_mac_setup , static bool mac_ie_vector_length_validate(ns_ie_iovec_t *ie_vector, uint16_t iov_length, uint16_t *length_out) { - *length_out = 0; + if (length_out) { + *length_out = 0; + } + if (!iov_length) { return true; } diff --git a/source/Service_Libs/fhss/fhss_configuration_interface.c b/source/Service_Libs/fhss/fhss_configuration_interface.c index 98b5cd1b202..72d1b23adf0 100644 --- a/source/Service_Libs/fhss/fhss_configuration_interface.c +++ b/source/Service_Libs/fhss/fhss_configuration_interface.c @@ -90,7 +90,6 @@ int ns_fhss_delete(fhss_api_t *fhss_api) return -1; } ns_dyn_mem_free(fhss_api); - fhss_api = NULL; return 0; } diff --git a/source/Service_Libs/fhss/fhss_ws.c b/source/Service_Libs/fhss/fhss_ws.c index a0736a198d5..8d6df8ed73e 100644 --- a/source/Service_Libs/fhss/fhss_ws.c +++ b/source/Service_Libs/fhss/fhss_ws.c @@ -77,11 +77,9 @@ fhss_structure_t *fhss_ws_enable(fhss_api_t *fhss_api, const fhss_ws_configurati static int32_t fhss_ws_calc_bc_channel(fhss_structure_t *fhss_structure) { - int32_t next_channel; - - if (fhss_structure->ws->fhss_configuration.ws_channel_function == WS_FIXED_CHANNEL) { + int32_t next_channel = fhss_structure->rx_channel; - } else if (fhss_structure->ws->fhss_configuration.ws_channel_function == WS_TR51CF) { + if (fhss_structure->ws->fhss_configuration.ws_channel_function == WS_TR51CF) { next_channel = tr51_get_bc_channel_index(fhss_structure->ws->bc_slot, fhss_structure->ws->fhss_configuration.bsi, fhss_structure->number_of_channels, NULL, 0); if (++fhss_structure->ws->bc_slot == fhss_structure->number_of_channels) { fhss_structure->ws->bc_slot = 0;