summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ccd/ccd.c10
-rw-r--r--sys/dev/md/md.c13
-rw-r--r--sys/dev/nmdm/nmdm.c2
-rw-r--r--sys/dev/pci/pci_user.c2
-rw-r--r--sys/dev/random/randomdev.c4
-rw-r--r--sys/dev/streams/streams.c2
-rw-r--r--sys/dev/syscons/syscons.c2
7 files changed, 17 insertions, 18 deletions
diff --git a/sys/dev/ccd/ccd.c b/sys/dev/ccd/ccd.c
index fcf968e..a1d1965 100644
--- a/sys/dev/ccd/ccd.c
+++ b/sys/dev/ccd/ccd.c
@@ -441,7 +441,7 @@ ccdinit(struct ccd_s *cs, char **cpaths, struct thread *td)
* Get partition information for the component.
*/
if ((error = VOP_IOCTL(vp, DIOCGPART, (caddr_t)&dpart,
- FREAD, td->td_proc->p_ucred, td)) != 0) {
+ FREAD, td->td_ucred, td)) != 0) {
#ifdef DEBUG
if (ccddebug & (CCDB_FOLLOW|CCDB_INIT))
printf("ccd%d: %s: ioctl failed, error = %d\n",
@@ -1328,7 +1328,7 @@ ccdioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
if ((error = ccdlookup(cpp[i], td, &vpp[i])) != 0) {
for (j = 0; j < lookedup; ++j)
(void)vn_close(vpp[j], FREAD|FWRITE,
- td->td_proc->p_ucred, td);
+ td->td_ucred, td);
free(vpp, M_DEVBUF);
free(cpp, M_DEVBUF);
ccdunlock(cs);
@@ -1345,7 +1345,7 @@ ccdioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
if ((error = ccdinit(cs, cpp, td)) != 0) {
for (j = 0; j < lookedup; ++j)
(void)vn_close(vpp[j], FREAD|FWRITE,
- td->td_proc->p_ucred, td);
+ td->td_ucred, td);
/*
* We can't ccddestroy() cs just yet, because nothing
* prevents user-level app to do another ioctl()
@@ -1406,7 +1406,7 @@ ccdioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
cs->sc_cinfo[i].ci_vp);
#endif
(void)vn_close(cs->sc_cinfo[i].ci_vp, FREAD|FWRITE,
- td->td_proc->p_ucred, td);
+ td->td_ucred, td);
free(cs->sc_cinfo[i].ci_path, M_DEVBUF);
}
@@ -1637,7 +1637,7 @@ bad:
VOP_UNLOCK(vp, 0, td);
NDFREE(&nd, NDF_ONLY_PNBUF);
/* vn_close does vrele() for vp */
- (void)vn_close(vp, FREAD|FWRITE, td->td_proc->p_ucred, td);
+ (void)vn_close(vp, FREAD|FWRITE, td->td_ucred, td);
return (error);
}
diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c
index 749e7a9..c1ddf8a 100644
--- a/sys/dev/md/md.c
+++ b/sys/dev/md/md.c
@@ -604,7 +604,6 @@ mdsetcred(struct md_s *sc, struct ucred *cred)
static int
mdcreate_vnode(struct md_ioctl *mdio, struct thread *td)
{
- struct proc *p = td->td_proc;
struct md_s *sc;
struct vattr vattr;
struct nameidata nd;
@@ -637,9 +636,9 @@ mdcreate_vnode(struct md_ioctl *mdio, struct thread *td)
}
NDFREE(&nd, NDF_ONLY_PNBUF);
if (nd.ni_vp->v_type != VREG ||
- (error = VOP_GETATTR(nd.ni_vp, &vattr, p->p_ucred, td))) {
+ (error = VOP_GETATTR(nd.ni_vp, &vattr, td->td_ucred, td))) {
VOP_UNLOCK(nd.ni_vp, 0, td);
- (void) vn_close(nd.ni_vp, flags, p->p_ucred, td);
+ (void) vn_close(nd.ni_vp, flags, td->td_ucred, td);
return (error ? error : EINVAL);
}
VOP_UNLOCK(nd.ni_vp, 0, td);
@@ -654,12 +653,12 @@ mdcreate_vnode(struct md_ioctl *mdio, struct thread *td)
else
sc->nsect = vattr.va_size / sc->secsize; /* XXX: round up ? */
if (sc->nsect == 0) {
- (void) vn_close(nd.ni_vp, flags, p->p_ucred, td);
+ (void) vn_close(nd.ni_vp, flags, td->td_ucred, td);
return (EINVAL);
}
- error = mdsetcred(sc, p->p_ucred);
+ error = mdsetcred(sc, td->td_ucred);
if (error) {
- (void) vn_close(nd.ni_vp, flags, p->p_ucred, td);
+ (void) vn_close(nd.ni_vp, flags, td->td_ucred, td);
return (error);
}
mdinit(sc);
@@ -749,7 +748,7 @@ mdcreate_swap(struct md_ioctl *mdio, struct thread *td)
return (EDOM);
}
}
- error = mdsetcred(sc, td->td_proc->p_ucred);
+ error = mdsetcred(sc, td->td_ucred);
if (error)
mddestroy(sc, td);
else
diff --git a/sys/dev/nmdm/nmdm.c b/sys/dev/nmdm/nmdm.c
index 46e7f3c..10d5d70 100644
--- a/sys/dev/nmdm/nmdm.c
+++ b/sys/dev/nmdm/nmdm.c
@@ -211,7 +211,7 @@ nmdmopen(dev_t dev, int flag, int devtype, struct thread *td)
tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED;
} else if (tp->t_state & TS_XCLUDE && suser_td(td)) {
return (EBUSY);
- } else if (pti->pt_prison != td->td_proc->p_ucred->cr_prison) {
+ } else if (pti->pt_prison != td->td_ucred->cr_prison) {
return (EBUSY);
}
diff --git a/sys/dev/pci/pci_user.c b/sys/dev/pci/pci_user.c
index 6131a43..83b63b3 100644
--- a/sys/dev/pci/pci_user.c
+++ b/sys/dev/pci/pci_user.c
@@ -91,7 +91,7 @@ pci_open(dev_t dev, int oflags, int devtype, struct thread *td)
int error;
if (oflags & FWRITE) {
- error = securelevel_gt(td->td_proc->p_ucred, 0);
+ error = securelevel_gt(td->td_ucred, 0);
if (error)
return (error);
}
diff --git a/sys/dev/random/randomdev.c b/sys/dev/random/randomdev.c
index cd6f873..fe73b0f 100644
--- a/sys/dev/random/randomdev.c
+++ b/sys/dev/random/randomdev.c
@@ -147,7 +147,7 @@ random_open(dev_t dev, int flags, int fmt, struct thread *td)
error = suser(td->td_proc);
if (error)
return (error);
- error = securelevel_gt(td->td_proc->p_ucred, 0);
+ error = securelevel_gt(td->td_ucred, 0);
if (error)
return (error);
}
@@ -159,7 +159,7 @@ random_close(dev_t dev, int flags, int fmt, struct thread *td)
{
if (flags & FWRITE) {
if (!(suser(td->td_proc) ||
- securelevel_gt(td->td_proc->p_ucred, 0)))
+ securelevel_gt(td->td_ucred, 0)))
random_reseed();
}
return 0;
diff --git a/sys/dev/streams/streams.c b/sys/dev/streams/streams.c
index a5c2b4d..1b916a1 100644
--- a/sys/dev/streams/streams.c
+++ b/sys/dev/streams/streams.c
@@ -265,7 +265,7 @@ streamsopen(dev_t dev, int oflags, int devtype, struct thread *td)
return error;
if ((error = socreate(family, &so, type, protocol,
- td->td_proc->p_ucred, td)) != 0) {
+ td->td_ucred, td)) != 0) {
FILEDESC_LOCK(p->p_fd);
p->p_fd->fd_ofiles[fd] = 0;
FILEDESC_UNLOCK(p->p_fd);
diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c
index 0a01b18..1e6a506 100644
--- a/sys/dev/syscons/syscons.c
+++ b/sys/dev/syscons/syscons.c
@@ -978,7 +978,7 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
error = suser_td(td);
if (error != 0)
return error;
- error = securelevel_gt(td->td_proc->p_ucred, 0);
+ error = securelevel_gt(td->td_ucred, 0);
if (error != 0)
return error;
#ifdef __i386__
OpenPOWER on IntegriCloud