summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFilip Tehlar <ftehlar@cisco.com>2022-03-14 13:42:36 +0000
committerFlorin Coras <florin.coras@gmail.com>2022-03-14 18:04:21 +0000
commit85a9c101bffe99da141b496f95966258b922a440 (patch)
tree3223660ef2291bcc9925d760004832b363bea6b5 /src
parenteb63caea2aacb60e05f956f0720d95267398e3ff (diff)
hsa: fix error message
Fixes a minor issue that causes printing an error message when there is no error. Type: fix Signed-off-by: Filip Tehlar <ftehlar@cisco.com> Change-Id: I59f5c6af7c5aeae3e812b4cf0c75a47894bb8bbd
Diffstat (limited to 'src')
-rw-r--r--src/plugins/hs_apps/sapi/vpp_echo_bapi.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/hs_apps/sapi/vpp_echo_bapi.c b/src/plugins/hs_apps/sapi/vpp_echo_bapi.c
index 2e997096f85..c3b53c86ae2 100644
--- a/src/plugins/hs_apps/sapi/vpp_echo_bapi.c
+++ b/src/plugins/hs_apps/sapi/vpp_echo_bapi.c
@@ -265,11 +265,11 @@ echo_segment_lookup (u64 segment_handle)
clib_spinlock_lock (&em->segment_handles_lock);
segment_idxp = hash_get (em->shared_segment_handles, segment_handle);
clib_spinlock_unlock (&em->segment_handles_lock);
- if (!segment_idxp)
- return ~0;
+ if (segment_idxp)
+ return ((u32) *segment_idxp);
ECHO_LOG (2, "Segment not mapped (0x%lx)", segment_handle);
- return ((u32) *segment_idxp);
+ return ~0;
}
void