aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorMoritz Fischer <moritz.fischer@ettus.com>2017-10-10 12:02:00 -0700
committerMartin Braun <martin.braun@ettus.com>2017-10-10 16:53:43 -0700
commit2029af39cc9d396f69c52550595d1aeedce5e2d2 (patch)
treeb7ac86d45ded5c423323700f2c5190fdebba8b47 /host
parentdc477f6bcd61c6833b5984d0cdc9a2a3d699b110 (diff)
downloaduhd-2029af39cc9d396f69c52550595d1aeedce5e2d2.tar.gz
uhd-2029af39cc9d396f69c52550595d1aeedce5e2d2.tar.bz2
uhd-2029af39cc9d396f69c52550595d1aeedce5e2d2.zip
transport: liberio: Check return values for liberio_chan_set_fixed_size()
Check return value of liberio_chan_set_fixed_size() since it can fail, and bad things happen if one just proceeds. Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
Diffstat (limited to 'host')
-rw-r--r--host/lib/transport/liberio_zero_copy.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/host/lib/transport/liberio_zero_copy.cpp b/host/lib/transport/liberio_zero_copy.cpp
index fb30f8936..40cedd3ed 100644
--- a/host/lib/transport/liberio_zero_copy.cpp
+++ b/host/lib/transport/liberio_zero_copy.cpp
@@ -143,8 +143,11 @@ public:
UHD_ASSERT_THROW(_tx_chan);
liberio_chan_stop_streaming(_tx_chan);
liberio_chan_request_buffers(_tx_chan, 0);
- liberio_chan_set_fixed_size(_tx_chan, 0,
- xport_params.send_frame_size);
+ UHD_ASSERT_THROW(
+ !liberio_chan_set_fixed_size(_tx_chan, 0,
+ xport_params.send_frame_size
+ )
+ );
UHD_ASSERT_THROW(
!liberio_chan_request_buffers(
_tx_chan, xport_params.num_send_frames
@@ -171,8 +174,11 @@ public:
/* stop the channel, free the buffers, set the size, allocate */
liberio_chan_stop_streaming(_rx_chan);
liberio_chan_request_buffers(_rx_chan, 0);
- liberio_chan_set_fixed_size(_rx_chan, 0,
- xport_params.recv_frame_size);
+ UHD_ASSERT_THROW(
+ !liberio_chan_set_fixed_size(_rx_chan, 0,
+ xport_params.recv_frame_size
+ )
+ );
UHD_ASSERT_THROW(!liberio_chan_request_buffers(
_rx_chan, xport_params.num_recv_frames));
_num_recv_bufs = liberio_chan_get_num_bufs(_rx_chan);