summaryrefslogtreecommitdiff
path: root/nuttx/fs
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2015-03-11 13:11:50 -0600
committerGregory Nutt <gnutt@nuttx.org>2015-03-11 13:11:50 -0600
commitbae429c68de1096f30e02c50a932b856778a3eef (patch)
treee908cfc9ac0390aeed07e7b75046b8b184621dbc /nuttx/fs
parent2219feb4cc346a233d4ab3fb4e0db5d16e38f8fb (diff)
downloadpx4-nuttx-bae429c68de1096f30e02c50a932b856778a3eef.tar.gz
px4-nuttx-bae429c68de1096f30e02c50a932b856778a3eef.tar.bz2
px4-nuttx-bae429c68de1096f30e02c50a932b856778a3eef.zip
FAT: fat_unbind() was accessing 'fs->fs_sem' after freeing the 'fs' struct. From Juha Niskanen.
Diffstat (limited to 'nuttx/fs')
-rw-r--r--nuttx/fs/fat/fs_fat32.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/nuttx/fs/fat/fs_fat32.c b/nuttx/fs/fat/fs_fat32.c
index 0ff7935ca..5cb58463a 100644
--- a/nuttx/fs/fat/fs_fat32.c
+++ b/nuttx/fs/fat/fs_fat32.c
@@ -1763,8 +1763,8 @@ static int fat_bind(FAR struct inode *blkdriver, const void *data,
}
/* Initialize the allocated mountpt state structure. The filesystem is
- * responsible for one reference ont the blkdriver inode and does not
- * have to addref() here (but does have to release in ubind().
+ * responsible for one reference on the blkdriver inode and does not
+ * have to addref() here (but does have to release in unbind().
*/
fs->fs_blkdriver = blkdriver; /* Save the block driver reference */
@@ -1849,7 +1849,9 @@ static int fat_unbind(void *handle, FAR struct inode **blkdriver)
fat_io_free(fs->fs_buffer, fs->fs_hwsectorsize);
}
+ sem_destroy(&fs->fs_sem);
kmm_free(fs);
+ return ret;
}
fat_semgive(fs);