From 87f04994cfa2431cc09168c47239f47f5a308cdd Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 29 May 2009 13:32:00 +0000 Subject: Fix mount problem git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1835 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/fs/fat/fs_fat32.c | 4 ++-- nuttx/fs/fs_mount.c | 11 +++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'nuttx/fs') diff --git a/nuttx/fs/fat/fs_fat32.c b/nuttx/fs/fat/fs_fat32.c index a0a277475..a28d57a4e 100644 --- a/nuttx/fs/fat/fs_fat32.c +++ b/nuttx/fs/fat/fs_fat32.c @@ -1,7 +1,7 @@ /**************************************************************************** * fs_fat32.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * References: @@ -1482,7 +1482,7 @@ static int fat_bind(FAR struct inode *blkdriver, const void *data, } if (blkdriver->u.i_bops->open && - blkdriver->u.i_bops->open(blkdriver) != OK) + blkdriver->u.i_bops->open(blkdriver) != OK) { return -ENODEV; } diff --git a/nuttx/fs/fs_mount.c b/nuttx/fs/fs_mount.c index d0806ba7d..22af7a136 100644 --- a/nuttx/fs/fs_mount.c +++ b/nuttx/fs/fs_mount.c @@ -1,7 +1,7 @@ /**************************************************************************** * fs/fs_mount.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -231,7 +231,7 @@ int mount(const char *source, const char *target, fdbg("Bind method failed: %d\n", status); errcode = -status; - goto errout_with_blkdrvr; + goto errout_with_mountpt; } /* We have it, now populate it with driver specific information. */ @@ -256,13 +256,16 @@ int mount(const char *source, const char *target, /* A lot of goto's! But they make the error handling much simpler */ -errout_with_blkdrvr: - inode_release(blkdrvr_inode); errout_with_mountpt: + inode_semgive(); + inode_release(blkdrvr_inode); inode_release(mountpt_inode); + goto errout; + errout_with_semaphore: inode_semgive(); inode_release(blkdrvr_inode); + errout: errno = errcode; return ERROR; -- cgit v1.2.3