Skip to content

Commit 40efd39

Browse files
Coverity tool reported error fix (ARMmbed#1776)
CID 270644 fixed.
1 parent b063457 commit 40efd39

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

source/Service_Libs/fhss/channel_functions.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ static uint16_t tr51_calc_nearest_prime_number(uint16_t start_value)
5151
while (start_value) {
5252
if (start_value % divider--) {
5353
if (divider == 1) {
54-
return start_value;
54+
break;
5555
}
5656
} else {
5757
divider = ++start_value - 1;
5858
}
5959
}
60-
return 0;
60+
return start_value;
6161
}
6262

6363
static void tr51_seed_rand(uint32_t seed)

0 commit comments

Comments
 (0)