summaryrefslogtreecommitdiff
path: root/sys/compat/linux
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2002-02-13 19:08:07 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2002-02-13 19:08:07 +0000
commita7e74053f365de72e8d1cd756cdf7601ba3d7428 (patch)
tree0d7df29afc1ffa666602d9492da703370c2b2aad /sys/compat/linux
parent380c15dc359d713114d5dce6b4a285852f414061 (diff)
More FREF/FRELE on relevant places. Now, only sys_mmap and a bunch of ioctl functions in sys/compat are left.
Diffstat (limited to 'sys/compat/linux')
-rw-r--r--sys/compat/linux/linux_blkio.c4
-rw-r--r--sys/compat/linux/linux_fdio.c4
-rw-r--r--sys/compat/linux/linux_file.c9
-rw-r--r--sys/compat/linux/linux_hdio.c10
4 files changed, 20 insertions, 7 deletions
diff --git a/sys/compat/linux/linux_blkio.c b/sys/compat/linux/linux_blkio.c
index 71bf8fb9f56..321afe91058 100644
--- a/sys/compat/linux/linux_blkio.c
+++ b/sys/compat/linux/linux_blkio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: linux_blkio.c,v 1.3 2002/02/08 00:03:46 art Exp $ */
+/* $OpenBSD: linux_blkio.c,v 1.4 2002/02/13 19:08:06 art Exp $ */
/* $NetBSD: linux_blkio.c,v 1.3 2001/01/18 17:48:04 tv Exp $ */
/*
@@ -71,6 +71,7 @@ linux_ioctl_blkio(struct proc *p, struct linux_sys_ioctl_args *uap,
fdp = p->p_fd;
if ((fp = fd_getfile(fdp, SCARG(uap, fd))) == NULL)
return (EBADF);
+ FREF(fp);
error = 0;
ioctlf = fp->f_ops->fo_ioctl;
com = SCARG(uap, com);
@@ -115,5 +116,6 @@ linux_ioctl_blkio(struct proc *p, struct linux_sys_ioctl_args *uap,
error = ENOTTY;
}
+ FRELE(fp);
return error;
}
diff --git a/sys/compat/linux/linux_fdio.c b/sys/compat/linux/linux_fdio.c
index 9363f9583be..cb711c9e13e 100644
--- a/sys/compat/linux/linux_fdio.c
+++ b/sys/compat/linux/linux_fdio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: linux_fdio.c,v 1.4 2002/02/08 00:03:46 art Exp $ */
+/* $OpenBSD: linux_fdio.c,v 1.5 2002/02/13 19:08:06 art Exp $ */
/* $NetBSD: linux_fdio.c,v 1.1 2000/12/10 14:12:16 fvdl Exp $ */
/*
@@ -78,6 +78,7 @@ linux_ioctl_fdio(struct proc *p, struct linux_sys_ioctl_args *uap,
if ((fp = fd_getfile(fdp, SCARG(uap, fd))) == NULL)
return (EBADF);
+ FREF(fp);
com = SCARG(uap, com);
ioctlf = fp->f_ops->fo_ioctl;
@@ -144,5 +145,6 @@ linux_ioctl_fdio(struct proc *p, struct linux_sys_ioctl_args *uap,
error = EINVAL;
}
+ FRELE(fp);
return 0;
}
diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c
index 9b2e3b49e8e..cd20ed709f8 100644
--- a/sys/compat/linux/linux_file.c
+++ b/sys/compat/linux/linux_file.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: linux_file.c,v 1.19 2002/02/02 16:05:58 art Exp $ */
+/* $OpenBSD: linux_file.c,v 1.20 2002/02/13 19:08:06 art Exp $ */
/* $NetBSD: linux_file.c,v 1.15 1996/05/20 01:59:09 fvdl Exp $ */
/*
@@ -196,8 +196,10 @@ linux_sys_open(p, v, retval)
if ((fp = fd_getfile(fdp, *retval)) == NULL)
return (EBADF);
+ FREF(fp);
if (fp->f_type == DTYPE_VNODE)
(fp->f_ops->fo_ioctl) (fp, TIOCSCTTY, (caddr_t) 0, p);
+ FRELE(fp);
}
return 0;
}
@@ -400,7 +402,10 @@ linux_sys_fcntl(p, v, retval)
vp = (struct vnode *)fp->f_data;
if (vp->v_type != VCHR)
return EINVAL;
- if ((error = VOP_GETATTR(vp, &va, p->p_ucred, p)))
+ FREF(fp);
+ error = VOP_GETATTR(vp, &va, p->p_ucred, p);
+ FRELE(fp);
+ if (error)
return error;
d_tty = cdevsw[major(va.va_rdev)].d_tty;
if (!d_tty || (!(tp = (*d_tty)(va.va_rdev))))
diff --git a/sys/compat/linux/linux_hdio.c b/sys/compat/linux/linux_hdio.c
index 746d070822a..6ec57f064e6 100644
--- a/sys/compat/linux/linux_hdio.c
+++ b/sys/compat/linux/linux_hdio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: linux_hdio.c,v 1.3 2002/02/08 00:03:46 art Exp $ */
+/* $OpenBSD: linux_hdio.c,v 1.4 2002/02/13 19:08:06 art Exp $ */
/* $NetBSD: linux_hdio.c,v 1.1 2000/12/10 14:12:17 fvdl Exp $ */
/*
@@ -80,6 +80,7 @@ linux_ioctl_hdio(struct proc *p, struct linux_sys_ioctl_args *uap,
if ((fp = fd_getfile(fdp, SCARG(uap, fd))) == NULL)
return (EBADF);
+ FREF(fp);
com = SCARG(uap, com);
ioctlf = fp->f_ops->fo_ioctl;
retval[0] = error = 0;
@@ -104,8 +105,10 @@ linux_ioctl_hdio(struct proc *p, struct linux_sys_ioctl_args *uap,
error = ioctlf(fp, ATAIOCCOMMAND, (caddr_t)&req, p);
if (error != 0)
break;
- if (req.retsts != ATACMD_OK)
- return EIO;
+ if (req.retsts != ATACMD_OK) {
+ error = EIO;
+ break;
+ }
error = copyin(atap, &ata, sizeof ata);
if (error != 0)
break;
@@ -175,5 +178,6 @@ linux_ioctl_hdio(struct proc *p, struct linux_sys_ioctl_args *uap,
error = EINVAL;
}
+ FRELE(fp);
return error;
}