summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Pierre André <jpandre@users.sourceforge.net>2012-08-22 10:00:22 +0200
committerJean-Pierre André <jpandre@users.sourceforge.net>2012-08-22 10:00:22 +0200
commitdc34383d0dae60435470bc74fb3b3382fcc3d9a5 (patch)
tree73ba77ed72a8305d6f80015dd3548dc5865c6dea
parentad43d9b576213da888caf8d8960747942d114f76 (diff)
downloadillumos-fusefs-dc34383d0dae60435470bc74fb3b3382fcc3d9a5.tar.gz
Defended against a wrong condition
-rw-r--r--kernel/fuse_vnops.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/kernel/fuse_vnops.c b/kernel/fuse_vnops.c
index 7a7be25..3413040 100644
--- a/kernel/fuse_vnops.c
+++ b/kernel/fuse_vnops.c
@@ -618,6 +618,13 @@ get_filehandle(struct vnode *vp, int flag, struct cred *credp,
fh_param.credp = credp;
fh_param.rw_mode = flag;
fh_param.fufh = NULL;
+ if (!VTOFD(vp)) {
+ /*
+ * Very bad : do not panic.
+ */
+ err = ENODEV;
+ goto out;
+ }
/*
* Check if we already have retrieved the file handle
* from user space before