From 1535052873e189f7e76cc3c45b5307a95dee9e57 Mon Sep 17 00:00:00 2001 From: Tom Tsou Date: Tue, 4 Oct 2016 12:04:40 -0700 Subject: mcbts: Fix maximum number in channels in multicarrier config Maximum number of carriers is fixed to 3 channels on a single physical RF channel. Fixes: Coverity CID 149353t Signed-off-by: Tom Tsou --- Transceiver52M/osmo-trx.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Transceiver52M/osmo-trx.cpp b/Transceiver52M/osmo-trx.cpp index 7c41780..6e6edfa 100644 --- a/Transceiver52M/osmo-trx.cpp +++ b/Transceiver52M/osmo-trx.cpp @@ -60,6 +60,9 @@ #define DEFAULT_DIVERSITY false #define DEFAULT_CHANS 1 +/* Max number of channels in multi-carrier configuration */ +#define MAX_MCHANS 3 + struct trx_config { std::string log_level; std::string addr; @@ -167,7 +170,7 @@ bool trx_setup_config(struct trx_config *config) if (!config->chans) config->chans = DEFAULT_CHANS; - if (config->mcbts && ((config->chans < 0) || (config->chans > 5))) { + if (config->mcbts && (config->chans > MAX_MCHANS)) { std::cout << "Unsupported number of channels" << std::endl; return false; } -- cgit v1.2.3