stm-st-stm32mp: gcnano: Fix Kernel NULL pointer on forced system shutdown

This commit adds a patch to the gcnano-driver-stm32mp recipe to address a
Kernel NULL pointer issue that occurs during uncontrolled shutdown sequences.
This issue causes an unexpected Kernel NULL pointer exception, preventing the
system from powering off.

https://onedigi.atlassian.net/browse/DEL-9449

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
This commit is contained in:
Arturo Buzarra 2025-01-27 14:54:56 +01:00
parent 7e7095b00f
commit 8089dd48df
2 changed files with 56 additions and 0 deletions

View File

@ -0,0 +1,49 @@
From: Arturo Buzarra <arturo.buzarra@digi.com>
Date: Mon, 27 Jan 2025 14:15:48 +0100
Subject: [PATCH] gc_hal_kernel_command: fix Kernel NULL pointer on
gckCOMMAND_Detach()
During uncontrolled shutdown sequences, detaching a user process might leave it
uninitialized, causing the gckCOMMAND pointer to be NULL. This results in an
unexpected Kernel NULL pointer exception, which prevents the system from
powering off.
https://onedigi.atlassian.net/browse/DEL-9449
Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
---
.../hal/kernel/gc_hal_kernel_command.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/hal/kernel/gc_hal_kernel_command.c b/hal/kernel/gc_hal_kernel_command.c
index 995947a..cd9907b 100644
--- a/hal/kernel/gc_hal_kernel_command.c
+++ b/hal/kernel/gc_hal_kernel_command.c
@@ -3885,15 +3885,16 @@ OnError:
gceSTATUS
gckCOMMAND_Detach(gckCOMMAND Command, gckCONTEXT Context)
{
- if (Command->feType == gcvHW_FE_WAIT_LINK || Command->feType == gcvHW_FE_END) {
- return _DetachWaitLinkFECommand(Command, Context);
- } else if (Command->feType == gcvHW_FE_MULTI_CHANNEL) {
- gcmkOS_SAFE_FREE(Context->os, Context);
- return gcvSTATUS_OK;
- } else {
- /* Nothing to do. */
- return gcvSTATUS_OK;
+ if (Command != gcvNULL) {
+ if (Command->feType == gcvHW_FE_WAIT_LINK || Command->feType == gcvHW_FE_END) {
+ return _DetachWaitLinkFECommand(Command, Context);
+ } else if (Command->feType == gcvHW_FE_MULTI_CHANNEL) {
+ gcmkOS_SAFE_FREE(Context->os, Context);
+ return gcvSTATUS_OK;
+ }
}
+ /* Nothing to do. */
+ return gcvSTATUS_OK;
}
static void
--
2.48.1

View File

@ -0,0 +1,7 @@
# Copyright (C) 2025, Digi International Inc.
FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:"
SRC_URI:append = " \
file://0001-gc_hal_kernel_command-fix-Kernel-NULL-pointer-on-gck.patch\
"