diff options
author | Tom Tsou <tom.tsou@ettus.com> | 2016-10-04 12:04:40 -0700 |
---|---|---|
committer | Tom Tsou <tom.tsou@ettus.com> | 2016-10-04 12:06:35 -0700 |
commit | 1535052873e189f7e76cc3c45b5307a95dee9e57 (patch) | |
tree | 2419c6e966d23c07b3280fea744541418a556b0a /Transceiver52M | |
parent | 49792aa1f7096f53fef6c09579826d5f02eab3a8 (diff) |
mcbts: Fix maximum number in channels in multicarrier configcoverity
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>
Diffstat (limited to 'Transceiver52M')
-rw-r--r-- | Transceiver52M/osmo-trx.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
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; } |