From 413808e155454559025c46c67127d79a7549123f Mon Sep 17 00:00:00 2001 From: Liu Xiaodong Date: Tue, 13 Jul 2021 04:35:33 -0400 Subject: [PATCH] app/trace: assert history ptr This is just assert to assure the Klocwork static analizer that ptr is not NULL. Change-Id: I458af194991fb1874fb7d32db55513a1f66408c0 Signed-off-by: Liu Xiaodong Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8745 Tested-by: SPDK CI Jenkins Reviewed-by: Reviewed-by: Shuhei Matsumoto Reviewed-by: Tomasz Zawadzki Community-CI: Broadcom CI Community-CI: Mellanox Build Bot --- app/trace/trace.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/app/trace/trace.cpp b/app/trace/trace.cpp index 2c4644895..7d378273c 100644 --- a/app/trace/trace.cpp +++ b/app/trace/trace.cpp @@ -197,6 +197,7 @@ get_next_buffer(struct spdk_trace_entry_buffer *buf, uint16_t lcore) struct spdk_trace_history *history; history = spdk_get_per_lcore_history(g_histories, lcore); + assert(history); if (spdk_unlikely((void *)buf == &history->entries[history->num_entries - 1])) { return (struct spdk_trace_entry_buffer *)&history->entries[0];