]> Zhao Yanbai Git Server - minix.git/commitdiff
VFS quits gracefully if mount fails and mounted_on remains uninitialized
authorTomas Hruby <tom@minix3.org>
Tue, 18 Aug 2009 13:30:05 +0000 (13:30 +0000)
committerTomas Hruby <tom@minix3.org>
Tue, 18 Aug 2009 13:30:05 +0000 (13:30 +0000)
servers/vfs/mount.c

index d337a4b3f3e0703584eb3b4b447f1c809addb99c..0324704b3b957088f6c61df150e6f5503bd67e38 100644 (file)
@@ -102,7 +102,7 @@ PRIVATE int mount_fs(endpoint_t fs_e)
   struct dmap *dp;
   dev_t dev;
   message m;
-  struct vnode *root_node, *mounted_on, *bspec;
+  struct vnode *root_node, *mounted_on = NULL, *bspec;
   struct vmnt *vmp;
   char *label;
   struct node_details res;
@@ -289,7 +289,8 @@ PRIVATE int mount_fs(endpoint_t fs_e)
   /* Issue request */
   r = req_readsuper(fs_e, label, dev, m_in.rd_only, isroot, &res);
   if (r != OK) {
-       put_vnode(mounted_on);
+       if (mounted_on)
+               put_vnode(mounted_on);
        return r;
   }