session: fix session_main_get_worker_if_valid 63/28163/6
authorNathan Skrzypczak <[email protected]>
Wed, 4 Dec 2019 10:02:28 +0000 (11:02 +0100)
committerAndrew Yourtchenko <[email protected]>
Fri, 7 Aug 2020 21:45:43 +0000 (21:45 +0000)
Type: fix

Change-Id: Ie024792015f3c9c52102c9be03da63c79f3456af
Signed-off-by: Nathan Skrzypczak <[email protected]>
(cherry picked from commit 901467ed75fa76e8fe4792459e3649d4aef4ddc7)

src/vnet/session/session.h

index 7b7addb..346af54 100644 (file)
@@ -598,7 +598,7 @@ session_main_get_worker (u32 thread_index)
 static inline session_worker_t *
 session_main_get_worker_if_valid (u32 thread_index)
 {
-  if (pool_is_free_index (session_main.wrk, thread_index))
+  if (thread_index > vec_len (session_main.wrk))
     return 0;
   return &session_main.wrk[thread_index];
 }