diff --git a/module/spl/spl-vnode.c b/module/spl/spl-vnode.c index 1e26b8e29a..4c62097dcc 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) {