From: Tomas Hruby Date: Tue, 18 Aug 2009 13:30:05 +0000 (+0000) Subject: VFS quits gracefully if mount fails and mounted_on remains uninitialized X-Git-Tag: v3.1.5~180 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zlib_tech.html?a=commitdiff_plain;h=f3e0c5c3817a9afb6b1ff7c933b79dd9209edc87;p=minix.git VFS quits gracefully if mount fails and mounted_on remains uninitialized --- diff --git a/servers/vfs/mount.c b/servers/vfs/mount.c index d337a4b3f..0324704b3 100644 --- a/servers/vfs/mount.c +++ b/servers/vfs/mount.c @@ -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; }