From 40efd3966867a84b4d3cee52f004f0c313306369 Mon Sep 17 00:00:00 2001 From: Deepak Venugopal Date: Tue, 7 Aug 2018 16:28:40 +0300 Subject: [PATCH] Coverity tool reported error fix (#1776) CID 270644 fixed. --- source/Service_Libs/fhss/channel_functions.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/Service_Libs/fhss/channel_functions.c b/source/Service_Libs/fhss/channel_functions.c index 0f8a840bb50..58bad623004 100644 --- a/source/Service_Libs/fhss/channel_functions.c +++ b/source/Service_Libs/fhss/channel_functions.c @@ -51,13 +51,13 @@ static uint16_t tr51_calc_nearest_prime_number(uint16_t start_value) while (start_value) { if (start_value % divider--) { if (divider == 1) { - return start_value; + break; } } else { divider = ++start_value - 1; } } - return 0; + return start_value; } static void tr51_seed_rand(uint32_t seed)