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 <tom.tsou@ettus.com>
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 @@
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;
}