[PATCH 2/4] record-client.c: Fix Unchecked return value (CID #1456677)

Ryan Long thisisryanlong at gmail.com
Fri Feb 26 21:34:45 UTC 2021


CID 1456677: Unchecked return value in resolve_hold_back().

Closes #4260
---
 cpukit/libtrace/record/record-client.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/cpukit/libtrace/record/record-client.c b/cpukit/libtrace/record/record-client.c
index 5a68115..975e3a7 100644
--- a/cpukit/libtrace/record/record-client.c
+++ b/cpukit/libtrace/record/record-client.c
@@ -124,6 +124,7 @@ static void resolve_hold_back(
     uint32_t last;
     uint32_t delta;
     uint64_t uptime;
+    rtems_record_client_status status;
 
     last_head = per_cpu->head[ per_cpu->tail_head_index ];
     last_tail = per_cpu->tail[ per_cpu->tail_head_index ];
@@ -192,7 +193,8 @@ static void resolve_hold_back(
       const rtems_record_item_64 *item;
 
       item = &per_cpu->items[ index ];
-      visit( ctx, item->event, item->data );
+      status = visit( ctx, item->event, item->data );
+      _Assert_Unused_variable_equals(status, RTEMS_RECORD_CLIENT_SUCCESS);
     }
   }
 }
-- 
1.8.3.1



More information about the devel mailing list