From a00c8c44916b03c90884d495db99d3b11fddef1d Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Thu, 5 Jul 2018 15:46:02 -0400 Subject: [PATCH] freebsd11_network: Add another missing NULL check to taskqueue_free. Also add missing \ns to the new printfs. --- src/libs/compat/freebsd11_network/callout.cpp | 2 +- src/libs/compat/freebsd11_network/taskqueue.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/libs/compat/freebsd11_network/callout.cpp b/src/libs/compat/freebsd11_network/callout.cpp index 3548ec8494..00f68d3180 100644 --- a/src/libs/compat/freebsd11_network/callout.cpp +++ b/src/libs/compat/freebsd11_network/callout.cpp @@ -213,7 +213,7 @@ _callout_stop_safe(struct callout *c, int safe) MutexLocker locker(sLock); if (c == NULL) { - printf("_callout_stop_safe called with NULL callout"); + printf("_callout_stop_safe called with NULL callout\n"); return 0; } diff --git a/src/libs/compat/freebsd11_network/taskqueue.c b/src/libs/compat/freebsd11_network/taskqueue.c index 89c7cbefac..67a45d3281 100644 --- a/src/libs/compat/freebsd11_network/taskqueue.c +++ b/src/libs/compat/freebsd11_network/taskqueue.c @@ -220,6 +220,11 @@ taskqueue_start_threads(struct taskqueue **taskQueue, int count, int priority, void taskqueue_free(struct taskqueue *taskQueue) { + if (taskQueue == NULL) { + printf("taskqueue_free called with NULL taskqueue\n"); + return; + } + /* lock and drain list? */ taskQueue->tq_flags &= ~TQ_FLAGS_ACTIVE; if (!taskQueue->tq_fast) @@ -248,7 +253,7 @@ taskqueue_drain(struct taskqueue *taskQueue, struct task *task) cpu_status status; if (taskQueue == NULL) { - printf("taskqueue_drain called with NULL taskqueue"); + printf("taskqueue_drain called with NULL taskqueue\n"); return; }