aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp
diff options
context:
space:
mode:
authormichael-west <michael.west@ettus.com>2021-04-29 18:38:29 -0700
committerAaron Rossetto <aaron.rossetto@ni.com>2021-05-05 13:08:04 -0500
commit3f7f0489fa3a2f46852511c5e1207b155d2cc12b (patch)
treedb427825df51dcbfb7e590d5eaa59fa2a3a81c11 /host/lib/usrp
parent87de94748ad5324024adb7d149878d7b6c92e71a (diff)
downloaduhd-3f7f0489fa3a2f46852511c5e1207b155d2cc12b.tar.gz
uhd-3f7f0489fa3a2f46852511c5e1207b155d2cc12b.tar.bz2
uhd-3f7f0489fa3a2f46852511c5e1207b155d2cc12b.zip
multi_usrp_rfnoc: Fix get_device()->get_tree()
Property tree access via the device tree was resulting in a segmentation fault because the device::_tree member was not properly initialized for the redirector_device class. The redirector_device also had a get_tree() method that was not actually called because the get_tree() method in the parent class was not declared virtual and all calls to get_tree() were done on the parent class (i.e. get_device()->get_tree(). - Added initializer for device::_tree member in redirector_device class constructor - Removed redirector_device::get_tree() method Signed-off-by: michael-west <michael.west@ettus.com>
Diffstat (limited to 'host/lib/usrp')
-rw-r--r--host/lib/usrp/multi_usrp_rfnoc.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/host/lib/usrp/multi_usrp_rfnoc.cpp b/host/lib/usrp/multi_usrp_rfnoc.cpp
index 6d0de68f9..f87e52190 100644
--- a/host/lib/usrp/multi_usrp_rfnoc.cpp
+++ b/host/lib/usrp/multi_usrp_rfnoc.cpp
@@ -74,7 +74,9 @@ constexpr char LOG_ID[] = "MULTI_USRP";
class redirector_device : public uhd::device
{
public:
- redirector_device(multi_usrp* musrp_ptr) : _musrp(musrp_ptr) {}
+ redirector_device(multi_usrp* musrp_ptr) : _musrp(musrp_ptr) {
+ _tree = musrp_ptr->get_tree();
+ }
rx_streamer::sptr get_rx_stream(const stream_args_t& args) override
{
@@ -102,11 +104,6 @@ public:
return false;
}
- uhd::property_tree::sptr get_tree(void) const
- {
- return _musrp->get_tree();
- }
-
device_filter_t get_device_type() const
{
return USRP;