From 7820a12c47bc4768951e371032cb622cccf5b4b0 Mon Sep 17 00:00:00 2001 From: ken Date: Fri, 11 May 2018 14:50:26 +0000 Subject: [PATCH] Clear out the entire structure, not just the size of a pointer to it. sys/dev/ocs/ocs_os.c: In ocs_thread_create(), use sizeof(*thread) (instead of sizeof(thread)) as the size argument to memset so that we clear out the entire thread structure instead of just a few bytes of it. Submitted by: jtl MFC after: 3 days --- sys/dev/ocs_fc/ocs_os.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ocs_fc/ocs_os.c b/sys/dev/ocs_fc/ocs_os.c index c7e881e3123e..478bf85da9d5 100644 --- a/sys/dev/ocs_fc/ocs_os.c +++ b/sys/dev/ocs_fc/ocs_os.c @@ -630,7 +630,7 @@ ocs_thread_create(ocs_os_handle_t os, ocs_thread_t *thread, ocs_thread_fctn fctn { int32_t rc = 0; - ocs_memset(thread, 0, sizeof(thread)); + ocs_memset(thread, 0, sizeof(*thread)); thread->fctn = fctn; thread->name = ocs_strdup(name);