summaryrefslogtreecommitdiffstats
path: root/cpukit/libfs/src/imfs/imfs_fsunmount.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2012-02-23 17:57:27 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2012-03-13 12:24:15 +0100
commit1bdff036acddbbc63aa849741abba6581549f7b6 (patch)
tree8cc1f06ac93045d8a7c35da41fd926c2d9e840f1 /cpukit/libfs/src/imfs/imfs_fsunmount.c
parentIMFS: Use unprotected chain operations (diff)
downloadrtems-1bdff036acddbbc63aa849741abba6581549f7b6.tar.bz2
IMFS: Reference counting for nodes
The introduction of reference counting of nodes avoids the removal of open nodes and potential usage of freed memory.
Diffstat (limited to 'cpukit/libfs/src/imfs/imfs_fsunmount.c')
-rw-r--r--cpukit/libfs/src/imfs/imfs_fsunmount.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/cpukit/libfs/src/imfs/imfs_fsunmount.c b/cpukit/libfs/src/imfs/imfs_fsunmount.c
index 49ade1bab9..6f9388ea86 100644
--- a/cpukit/libfs/src/imfs/imfs_fsunmount.c
+++ b/cpukit/libfs/src/imfs/imfs_fsunmount.c
@@ -63,8 +63,9 @@ void IMFS_fsunmount(
if ( jnode->type != IMFS_DIRECTORY || jnode_has_no_children( jnode ) ) {
result = IMFS_rmnod( NULL, &loc );
- if (result != 0)
- rtems_fatal_error_occurred(0xdeadbeef);
+ if ( result != 0 )
+ rtems_fatal_error_occurred( 0xdeadbeef );
+ IMFS_node_destroy( jnode );
jnode = next;
}
if ( jnode != NULL ) {