diff options
author | Martin Braun <martin.braun@ettus.com> | 2021-12-06 10:01:51 +0100 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2021-12-06 07:09:14 -0800 |
commit | 8ce91bc7383409602206128839a0cf2daa932319 (patch) | |
tree | 5730d4dc5280fe2d62c3f8f8caea3a0be20e166e /host/lib/include | |
parent | e1e1aad5c5a8e8a14d8c446690e6268d40cc8ae1 (diff) | |
download | uhd-8ce91bc7383409602206128839a0cf2daa932319.tar.gz uhd-8ce91bc7383409602206128839a0cf2daa932319.tar.bz2 uhd-8ce91bc7383409602206128839a0cf2daa932319.zip |
mpm: x4xx: Add checks before accessing self.dio_control
The X4x0 MPM code doesn't always load the object for the DIO control, it
only does that when certain checks pass (EEPROM readouts need to match
expected values). Therefore, `self.dio_control` may be NoneObject during
operations, and in other areas of the code, we already check if that's
the case.
The APIs added in c36fc5f don't have these checks, which means accessing
these new APIs may result in odd exceptions when trying to dereference
a NoneType object. By adding checks for the initialization state of
`self.dio_control`, we can avoid these and either substitute better
error messages / exception messages, or return safe values.
Note that mpmd_mb_controller also accesses this object indirectly by
checking the length of the return value of get_gpio_banks(). This check
is not affected by this change, as we now are guaranteed to return an
empty list if there is no self.dio_control.
Diffstat (limited to 'host/lib/include')
0 files changed, 0 insertions, 0 deletions