diff --git a/lib/thread/thread.c b/lib/thread/thread.c index cd109c8a7..b1ebba01f 100644 --- a/lib/thread/thread.c +++ b/lib/thread/thread.c @@ -1586,6 +1586,10 @@ static void wrong_thread(const char *func, const char *name, struct spdk_thread *thread, struct spdk_thread *curthread) { + if (thread == NULL) { + SPDK_ERRLOG("%s(%s) called with NULL thread\n", func, name); + abort(); + } SPDK_ERRLOG("%s(%s) called from wrong thread %s:%" PRIu64 " (should be " "%s:%" PRIu64 ")\n", func, name, curthread->name, curthread->id, thread->name, thread->id);