aboutsummaryrefslogtreecommitdiffstats
path: root/libtransport/src/core
diff options
context:
space:
mode:
authorMauro Sardara <msardara@cisco.com>2020-12-10 08:40:15 +0100
committerMauro Sardara <msardara@cisco.com>2020-12-10 07:41:39 +0000
commit5811ac4c55ec38968495fff2e0c36a323b3d1df7 (patch)
treefcaf675c9f4442ea63ae7d28851aba764557886d /libtransport/src/core
parent86173b2d4624dfe7a563fcf86a0f0c5695cd1d2a (diff)
[HICN-658] Return error if buffer allocation fails in memif connector.
Signed-off-by: Mauro Sardara <msardara@cisco.com> Change-Id: Ie2cf44229bda3d9bf72a67df45e919067c206a7e
Diffstat (limited to 'libtransport/src/core')
-rw-r--r--libtransport/src/core/memif_connector.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/libtransport/src/core/memif_connector.cc b/libtransport/src/core/memif_connector.cc
index 49e1cf027..087e8cba8 100644
--- a/libtransport/src/core/memif_connector.cc
+++ b/libtransport/src/core/memif_connector.cc
@@ -442,7 +442,7 @@ void MemifConnector::send(const Packet::MemBufPtr &packet) {
int MemifConnector::doSend() {
std::size_t max = 0;
- uint16_t n = 0;
+ int32_t n = 0;
std::size_t size = 0;
{
@@ -452,9 +452,9 @@ int MemifConnector::doSend() {
do {
max = size < MAX_MEMIF_BUFS ? size : MAX_MEMIF_BUFS;
+ n = bufferAlloc(max, memif_connection_->tx_qid);
- if (TRANSPORT_EXPECT_FALSE(
- (n = bufferAlloc(max, memif_connection_->tx_qid)) < 0)) {
+ if (TRANSPORT_EXPECT_FALSE(n < 0)) {
TRANSPORT_LOGE("Error allocating buffers.");
return -1;
}