aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorAaron Rossetto <aaron.rossetto@ni.com>2020-05-21 09:05:34 -0500
committerAaron Rossetto <aaron.rossetto@ni.com>2020-05-28 14:49:32 -0500
commite063e17a1f9a182eba7b8babd126ba34a8af79e0 (patch)
tree0250dd855e7bf792c8b630d394883539855b286a /host
parentc27c8db011ea6ad1d0682ee06eede75989622b95 (diff)
downloaduhd-e063e17a1f9a182eba7b8babd126ba34a8af79e0.tar.gz
uhd-e063e17a1f9a182eba7b8babd126ba34a8af79e0.tar.bz2
uhd-e063e17a1f9a182eba7b8babd126ba34a8af79e0.zip
rfnoc: Fix _has_port() port existence check
This commit fixes a bug in node_t::_has_port(), which was using the wrong comparison operator to determine if the instance value in the incoming res_source_info parameter is within a valid range.
Diffstat (limited to 'host')
-rw-r--r--host/lib/rfnoc/node.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/host/lib/rfnoc/node.cpp b/host/lib/rfnoc/node.cpp
index ff3df7b76..7cc656a26 100644
--- a/host/lib/rfnoc/node.cpp
+++ b/host/lib/rfnoc/node.cpp
@@ -581,7 +581,7 @@ void node_t::shutdown()
bool node_t::_has_port(const res_source_info& port_info) const
{
return (port_info.type == res_source_info::INPUT_EDGE
- && port_info.instance <= get_num_input_ports())
+ && port_info.instance < get_num_input_ports())
|| (port_info.type == res_source_info::OUTPUT_EDGE
- && port_info.instance <= get_num_output_ports());
+ && port_info.instance < get_num_output_ports());
}