From ea8bdfab3fb40b32f2936c6f7f6ee75e268b671c Mon Sep 17 00:00:00 2001 From: Jerry Sun Date: Tue, 26 Aug 2025 14:32:02 -0500 Subject: [PATCH 1/2] zero initialize ref_cntx before use --- frame/base/bli_gks.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frame/base/bli_gks.c b/frame/base/bli_gks.c index 8904a9e67c..f15532a3ba 100644 --- a/frame/base/bli_gks.c +++ b/frame/base/bli_gks.c @@ -351,6 +351,7 @@ bool bli_gks_cntx_ukr_is_ref ) { cntx_t ref_cntx; + memset( &ref_cntx, 0, sizeof( ref_cntx ) ); // Initialize a context with reference kernels for the arch_t id queried // via bli_arch_query_id(). @@ -376,6 +377,7 @@ bool bli_gks_cntx_ukr2_is_ref ) { cntx_t ref_cntx; + memset( &ref_cntx, 0, sizeof( ref_cntx ) ); // Initialize a context with reference kernels for the arch_t id queried // via bli_arch_query_id(). From d2d0ddba88fda5d06a0f18c99624accf063d6164 Mon Sep 17 00:00:00 2001 From: Jerry Sun Date: Fri, 5 Sep 2025 20:48:28 -0500 Subject: [PATCH 2/2] move memset to bli_gks_init_ref_cntx --- frame/base/bli_gks.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/frame/base/bli_gks.c b/frame/base/bli_gks.c index f15532a3ba..a793eb78d6 100644 --- a/frame/base/bli_gks.c +++ b/frame/base/bli_gks.c @@ -338,6 +338,7 @@ void bli_gks_init_ref_cntx cntx_init_ft f = cntx_ref_init[ id ]; // Initialize the caller's context with reference kernels and related values. + memset( &cntx, 0, sizeof( cntx ) ); f( cntx ); } @@ -351,7 +352,6 @@ bool bli_gks_cntx_ukr_is_ref ) { cntx_t ref_cntx; - memset( &ref_cntx, 0, sizeof( ref_cntx ) ); // Initialize a context with reference kernels for the arch_t id queried // via bli_arch_query_id(). @@ -377,7 +377,6 @@ bool bli_gks_cntx_ukr2_is_ref ) { cntx_t ref_cntx; - memset( &ref_cntx, 0, sizeof( ref_cntx ) ); // Initialize a context with reference kernels for the arch_t id queried // via bli_arch_query_id().