close device if mount fails after device opened.
This commit is contained in:
parent
b74b3315a3
commit
b6e07e1835
@ -91,15 +91,21 @@ PUBLIC int fs_readsuper_s()
|
|||||||
/* Is it recognized as a Minix filesystem? */
|
/* Is it recognized as a Minix filesystem? */
|
||||||
if (r != OK) {
|
if (r != OK) {
|
||||||
sp->s_dev = NO_DEV;
|
sp->s_dev = NO_DEV;
|
||||||
|
dev_close(driver_e, fs_dev);
|
||||||
return(r);
|
return(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get the root inode of the mounted file system. */
|
/* 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;
|
return err_code;
|
||||||
|
}
|
||||||
|
|
||||||
if (root_ip != NIL_INODE && root_ip->i_mode == 0) {
|
if (root_ip != NIL_INODE && root_ip->i_mode == 0) {
|
||||||
put_inode(root_ip);
|
put_inode(root_ip);
|
||||||
|
sp->s_dev = NO_DEV;
|
||||||
|
dev_close(driver_e, fs_dev);
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user