RTEMS | System would crash when shm_open fail (!536)
yang zhang (@yang.zhang)
gitlab at rtems.org
Mon Jul 21 03:14:48 UTC 2025
yang zhang commented on a discussion: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/536#note_126958
Sorry, when if found and fix this issue, my local code is not very up-to-date.
This commit df1d85c0f8ffedf9621accc2a9e6fb8e288a430f conveniently resolved this issue by checking whether this variable is NULL, i will close this MR.
diff --git a/cpukit/libcsupport/src/freenode.c b/cpukit/libcsupport/src/freenode.c
index 1e9fd29297..f37b8fae5f 100644
--- a/cpukit/libcsupport/src/freenode.c
+++ b/cpukit/libcsupport/src/freenode.c
@@ -43,8 +43,10 @@
void rtems_filesystem_location_free( rtems_filesystem_location_info_t *loc )
{
- rtems_filesystem_instance_lock( loc );
- (*loc->mt_entry->ops->freenod_h)( loc );
- rtems_filesystem_instance_unlock( loc );
- rtems_filesystem_location_remove_from_mt_entry( loc );
+ if ( loc->mt_entry != NULL ) {
+ rtems_filesystem_instance_lock( loc );
+ (*loc->mt_entry->ops->freenod_h)( loc );
+ rtems_filesystem_instance_unlock( loc );
+ rtems_filesystem_location_remove_from_mt_entry( loc );
+ }
}
--
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/536#note_126958
You're receiving this email because of your account on gitlab.rtems.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20250721/bd1fb3cd/attachment.htm>
More information about the bugs
mailing list