From 9935282d504053e04018cc9710654caadf52c3a1 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Tue, 9 Oct 2001 16:37:51 +0000 Subject: Use crhold() instead of crdup(). The md(4) driver doesn't modify the ucred that it uses, so it merely needs to bump its refcount to make it immutable rather than obtain its own copy. --- sys/dev/md/md.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sys/dev/md') diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c index 9666ef393eef8..00317f1fd8baf 100644 --- a/sys/dev/md/md.c +++ b/sys/dev/md/md.c @@ -612,7 +612,8 @@ mdsetcred(struct md_s *sc, struct ucred *cred) if (sc->cred) crfree(sc->cred); - sc->cred = crdup(cred); + crhold(cred); + sc->cred = cred; /* * Horrible kludge to establish credentials for NFS XXX. -- cgit v1.3