summaryrefslogtreecommitdiff
path: root/nuttx/fs/fs_mount.c
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/fs/fs_mount.c')
-rw-r--r--nuttx/fs/fs_mount.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/nuttx/fs/fs_mount.c b/nuttx/fs/fs_mount.c
index 1f64b1eb2..00b80a574 100644
--- a/nuttx/fs/fs_mount.c
+++ b/nuttx/fs/fs_mount.c
@@ -225,6 +225,10 @@ int mount(const char *source, const char *target,
goto errout_with_mountpt;
}
+ /* Increment reference count for the reference we pass to the file system */
+
+ blkdrvr_inode->i_crefs++;
+
/* On failure, the bind method returns -errorcode */
status = mops->bind(blkdrvr_inode, data, &fshandle);
@@ -233,7 +237,7 @@ int mount(const char *source, const char *target,
/* The inode is unhappy with the blkdrvr for some reason */
errcode = -status;
- goto errout_with_mountpt;
+ goto errout_with_blkdrvr2;
}
/* We have it, now populate it with driver specific information. */
@@ -258,6 +262,9 @@ int mount(const char *source, const char *target,
/* A lot of goto's! But they make the error handling much simpler */
+ errout_with_blkdrvr2:
+ inode_release(blkdrvr_inode);
+
errout_with_mountpt:
inode_release(mountpt_inode);