From: Ben Gras Date: Wed, 26 Sep 2007 15:06:41 +0000 (+0000) Subject: close device if mount fails after device opened. X-Git-Tag: v3.1.4~320 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/doc/syslog.conf.5.html?a=commitdiff_plain;h=b6e07e1835017e7843b99a341b65a6c61d18f0f1;p=minix.git close device if mount fails after device opened. --- diff --git a/servers/mfs/mount.c b/servers/mfs/mount.c index 8893307ea..2a802b925 100644 --- a/servers/mfs/mount.c +++ b/servers/mfs/mount.c @@ -91,15 +91,21 @@ PUBLIC int fs_readsuper_s() /* Is it recognized as a Minix filesystem? */ if (r != OK) { sp->s_dev = NO_DEV; + dev_close(driver_e, fs_dev); return(r); } /* Get the root inode of the mounted file system. */ - if ( (root_ip = get_inode(fs_dev, ROOT_INODE)) == NIL_INODE) + if ( (root_ip = get_inode(fs_dev, ROOT_INODE)) == NIL_INODE) { + sp->s_dev = NO_DEV; + dev_close(driver_e, fs_dev); return err_code; + } if (root_ip != NIL_INODE && root_ip->i_mode == 0) { put_inode(root_ip); + sp->s_dev = NO_DEV; + dev_close(driver_e, fs_dev); return EINVAL; }