api: fix vlibmemory coverity warning CID-300152 13/39413/2
authorDave Wallace <dwallacelf@gmail.com>
Wed, 23 Aug 2023 03:42:02 +0000 (23:42 -0400)
committerAndrew Yourtchenko <ayourtch@gmail.com>
Wed, 13 Sep 2023 15:50:15 +0000 (15:50 +0000)
Type: fix

Change-Id: Icdebc8629946e0e7c8dde3e45ee93ff9027e7c68
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
src/vlibmemory/socket_api.c

index 24a4609..c139b65 100644 (file)
@@ -288,6 +288,10 @@ vl_socket_read_ready (clib_file_t * uf)
     }
 
   rp = vl_socket_get_registration (reg_index);
+  if (!rp)
+    {
+      return 0;
+    }
 
   /* Ignore unprocessed_input for now, n describes input_buffer for now. */
   n = read (uf->file_descriptor, socket_main.input_buffer,