From f3e0c5c3817a9afb6b1ff7c933b79dd9209edc87 Mon Sep 17 00:00:00 2001 From: Tomas Hruby Date: Tue, 18 Aug 2009 13:30:05 +0000 Subject: [PATCH] VFS quits gracefully if mount fails and mounted_on remains uninitialized --- servers/vfs/mount.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; }