RTEMS | cpukit/libio: Fix race condition in iop free (!1048)

Gedare Bloom (@gedare) gitlab at rtems.org
Fri Feb 6 20:29:16 UTC 2026




Gedare Bloom started a new discussion: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1048#note_142089


Fix the format error:

```
gedare at localhost:~/rtems/rtems$ git clang-format HEAD^
changed files:
    cpukit/libcsupport/src/libio.c
gedare at localhost:~/rtems/rtems$ git diff
diff --git a/cpukit/libcsupport/src/libio.c b/cpukit/libcsupport/src/libio.c
index 777109d1c9..4aaf984e1d 100644
--- a/cpukit/libcsupport/src/libio.c
+++ b/cpukit/libcsupport/src/libio.c
@@ -157,7 +157,7 @@ void rtems_libio_free_iop( rtems_libio_t *iop )
   unsigned int flags;
 
   flags = rtems_libio_iop_flags_set( iop, LIBIO_FLAGS_FREE );
-  if ( (flags & LIBIO_FLAGS_FREE ) == 0 ) {
+  if ( ( flags & LIBIO_FLAGS_FREE ) == 0 ) {
     rtems_libio_lock();
     /*
      * Clear the flags. All references should have been dropped.
@@ -177,7 +177,6 @@ void rtems_libio_free_iop( rtems_libio_t *iop )
     rtems_libio_iop_free_tail = &iop->data1;
     rtems_libio_unlock();
   }
-
 }
 
 int rtems_libio_count_open_iops( void )
```

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1048#note_142089
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/20260206/360ce769/attachment-0001.htm>


More information about the bugs mailing list