diff --git a/sys/netsmb/smb_dev.c b/sys/netsmb/smb_dev.c index a69d0f0d100b..2bc5b4fa3d41 100644 --- a/sys/netsmb/smb_dev.c +++ b/sys/netsmb/smb_dev.c @@ -396,11 +396,11 @@ smb_dev2share(int fd, int mode, struct smb_cred *scred, fdrop(fp, curthread); return EBADF; } - dev = vn_todev(vp); - if (dev == NULL) { + if (vp->v_type != VCHR) { fdrop(fp, curthread); return EBADF; } + dev = vp->v_rdev; SMB_CHECKMINOR(dev); ssp = sdp->sd_share; if (ssp == NULL) {