Skip to content

Commit

Permalink
Fix Coverity warning
Browse files Browse the repository at this point in the history
Fixed Coverity warning "stored value is overwritten before it can be used".
  • Loading branch information
Kimmo Vaisanen committed Apr 10, 2018
1 parent 10c269b commit 01fd880
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions features/lorawan/lorastack/mac/LoRaMac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1102,7 +1102,6 @@ lorawan_status_t LoRaMac::schedule_tx(void)
{
lorawan_time_t dutyCycleTimeOff = 0;
channel_selection_params_t nextChan;
lorawan_status_t status = LORAWAN_STATUS_PARAMETER_INVALID;

if (_params.sys_params.max_duty_cycle == 255) {
return LORAWAN_STATUS_DEVICE_OFF;
Expand All @@ -1121,9 +1120,10 @@ lorawan_status_t LoRaMac::schedule_tx(void)
nextChan.joined = _is_nwk_joined;
nextChan.last_aggregate_tx_time = _params.timers.aggregated_last_tx_time;

status = _lora_phy.set_next_channel(&nextChan, &_params.channel,
&dutyCycleTimeOff,
&_params.timers.aggregated_timeoff);
lorawan_status_t status = _lora_phy.set_next_channel(&nextChan,
&_params.channel,
&dutyCycleTimeOff,
&_params.timers.aggregated_timeoff);
switch (status) {
case LORAWAN_STATUS_NO_CHANNEL_FOUND:
case LORAWAN_STATUS_NO_FREE_CHANNEL_FOUND:
Expand Down

0 comments on commit 01fd880

Please sign in to comment.