aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/x300/x300_impl.cpp
diff options
context:
space:
mode:
authorMark Meserve <mark.meserve@ni.com>2018-04-10 13:35:19 -0500
committerMartin Braun <martin.braun@ettus.com>2018-04-10 15:02:52 -0700
commitff3179fef651ec3ef6ff4b6d693a00de4a240104 (patch)
treef977087fa91e713a523db4c8ac4fb3644d051524 /host/lib/usrp/x300/x300_impl.cpp
parentfbd491862528d19f840dc3a6ab0a95ca1f95d2c4 (diff)
downloaduhd-ff3179fef651ec3ef6ff4b6d693a00de4a240104.tar.gz
uhd-ff3179fef651ec3ef6ff4b6d693a00de4a240104.tar.bz2
uhd-ff3179fef651ec3ef6ff4b6d693a00de4a240104.zip
x300: handle bad weak_ptr during pcie discovery
Diffstat (limited to 'host/lib/usrp/x300/x300_impl.cpp')
-rw-r--r--host/lib/usrp/x300/x300_impl.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/host/lib/usrp/x300/x300_impl.cpp b/host/lib/usrp/x300/x300_impl.cpp
index 97551e07a..d74aad806 100644
--- a/host/lib/usrp/x300/x300_impl.cpp
+++ b/host/lib/usrp/x300/x300_impl.cpp
@@ -213,7 +213,15 @@ static device_addrs_t x300_find_pcie(const device_addr_t &hint, bool explicit_qu
if (get_pcie_zpu_iface_registry().has_key(resource_d)) {
zpu_ctrl = get_pcie_zpu_iface_registry()[resource_d].lock();
- } else {
+ if (!zpu_ctrl)
+ {
+ get_pcie_zpu_iface_registry().pop(resource_d);
+ }
+ }
+
+ // if the registry didn't have a key OR that key was an orphaned weak_ptr
+ if (!zpu_ctrl)
+ {
zpu_ctrl = x300_make_ctrl_iface_pcie(kernel_proxy, false /* suppress timeout errors */);
//We don't put this zpu_ctrl in the registry because we need
//a persistent niriok_proxy associated with the object