aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--module/spl/spl-vnode.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/module/spl/spl-vnode.c b/module/spl/spl-vnode.c
index 1e26b8e29..4c62097dc 100644
--- a/module/spl/spl-vnode.c
+++ b/module/spl/spl-vnode.c
@@ -648,6 +648,9 @@ vn_getf(int fd)
vnode_t *vp;
int rc = 0;
+ if (fd < 0)
+ return (NULL);
+
/* Already open just take an extra reference */
spin_lock(&vn_file_lock);
@@ -733,6 +736,9 @@ vn_releasef(int fd)
{
file_t *fp;
+ if (fd < 0)
+ return;
+
spin_lock(&vn_file_lock);
fp = file_find(fd);
if (fp) {