diff options
-rw-r--r-- | sys/dev/diskmap.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/diskmap.c b/sys/dev/diskmap.c index 2c9ecfdfb62..d13763d5d78 100644 --- a/sys/dev/diskmap.c +++ b/sys/dev/diskmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diskmap.c,v 1.21 2018/07/03 05:50:46 mpi Exp $ */ +/* $OpenBSD: diskmap.c,v 1.22 2018/07/04 12:42:30 mpi Exp $ */ /* * Copyright (c) 2009, 2010 Joel Sing <jsing@openbsd.org> @@ -86,7 +86,7 @@ diskmapioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p) NDINIT(&ndp, 0, 0, UIO_SYSSPACE, devname, p); ndp.ni_pledge = PLEDGE_RPATH; if ((error = vn_open(&ndp, fp0->f_flag, 0)) != 0) - goto bad; + goto invalid; vp = ndp.ni_vp; VOP_UNLOCK(vp); @@ -138,10 +138,10 @@ bad: if (vp) vrele(vp); +invalid: if (fp0) FRELE(fp0, p); -invalid: free(devname, M_DEVBUF, PATH_MAX); return (error); |