summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux/linux_misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/compat/linux/linux_misc.c')
-rw-r--r--sys/compat/linux/linux_misc.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c
index 10eaa6e..0caff43 100644
--- a/sys/compat/linux/linux_misc.c
+++ b/sys/compat/linux/linux_misc.c
@@ -185,7 +185,6 @@ linux_uselib(struct proc *p, struct linux_uselib_args *args)
struct vnode *vp;
struct exec *a_out;
struct vattr attr;
- struct ucred *uc;
vm_offset_t vmaddr;
unsigned long file_offset;
vm_offset_t buffer;
@@ -237,21 +236,14 @@ linux_uselib(struct proc *p, struct linux_uselib_args *args)
/*
* Executable?
*/
- PROC_LOCK(p);
- uc = p->p_ucred;
- crhold(uc);
- PROC_UNLOCK(p);
- error = VOP_GETATTR(vp, &attr, uc, p);
- if (error) {
- crfree(uc);
+ error = VOP_GETATTR(vp, &attr, p->p_ucred, p);
+ if (error)
goto cleanup;
- }
if ((vp->v_mount->mnt_flag & MNT_NOEXEC) ||
((attr.va_mode & 0111) == 0) ||
(attr.va_type != VREG)) {
error = ENOEXEC;
- crfree(uc);
goto cleanup;
}
@@ -260,21 +252,17 @@ linux_uselib(struct proc *p, struct linux_uselib_args *args)
*/
if (attr.va_size == 0) {
error = ENOEXEC;
- crfree(uc);
goto cleanup;
}
/*
* Can we access it?
*/
- error = VOP_ACCESS(vp, VEXEC, uc, p);
- if (error) {
- crfree(uc);
+ error = VOP_ACCESS(vp, VEXEC, p->p_ucred, p);
+ if (error)
goto cleanup;
- }
- error = VOP_OPEN(vp, FREAD, uc, p);
- crfree(uc);
+ error = VOP_OPEN(vp, FREAD, p->p_ucred, p);
if (error)
goto cleanup;
OpenPOWER on IntegriCloud