summaryrefslogtreecommitdiffstats
path: root/src/svm
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-06-24 16:54:52 -0700
committerDave Wallace <dwallacelf@gmail.com>2019-06-25 14:29:22 +0000
commit8eb3e07dea2c905ab46e0236bca9750224484ee8 (patch)
treea6a66fb73b579b6ad5b8878c20bbfa7479b80d01 /src/svm
parente3b8682d3f180a89ef7c37a7387adbfa088013b9 (diff)
svm: make sure chunk search does not return tnil
Type:fix Change-Id: I8405bf8d93b4468c54f4f3c5dcd21ef91a6b1048 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/svm')
-rw-r--r--src/svm/svm_fifo.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/svm/svm_fifo.c b/src/svm/svm_fifo.c
index 87e019ab1f1..3d538293c70 100644
--- a/src/svm/svm_fifo.c
+++ b/src/svm/svm_fifo.c
@@ -496,6 +496,8 @@ svm_fifo_find_chunk (svm_fifo_t * f, u32 pos)
if (pos < prev->key)
{
cur = rb_tree_predecessor (rt, prev);
+ if (rb_node_is_tnil (rt, cur))
+ return 0;
c = uword_to_pointer (cur->opaque, svm_fifo_chunk_t *);
if (svm_fifo_chunk_includes_pos (c, pos))
return c;