summaryrefslogtreecommitdiffstats
path: root/sys/security/mac/mac_syscalls.c
diff options
context:
space:
mode:
authortegge <tegge@FreeBSD.org>2006-03-19 20:43:07 +0000
committertegge <tegge@FreeBSD.org>2006-03-19 20:43:07 +0000
commit6d1ce4168f5a52c136e43bf86897bfefcfa348d6 (patch)
tree8edc187b644460d07107891b81a42ee94fa3f71e /sys/security/mac/mac_syscalls.c
parent1a9351b430b5dff12778dbdd564057d6120e6e15 (diff)
downloadFreeBSD-src-6d1ce4168f5a52c136e43bf86897bfefcfa348d6.zip
FreeBSD-src-6d1ce4168f5a52c136e43bf86897bfefcfa348d6.tar.gz
Don't call vn_finished_write() if vn_start_write() failed.
Diffstat (limited to 'sys/security/mac/mac_syscalls.c')
-rw-r--r--sys/security/mac/mac_syscalls.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/security/mac/mac_syscalls.c b/sys/security/mac/mac_syscalls.c
index fd28931..19e6d7d 100644
--- a/sys/security/mac/mac_syscalls.c
+++ b/sys/security/mac/mac_syscalls.c
@@ -1069,10 +1069,11 @@ __mac_set_file(struct thread *td, struct __mac_set_file_args *uap)
vfslocked = NDHASGIANT(&nd);
if (error == 0) {
error = vn_start_write(nd.ni_vp, &mp, V_WAIT | PCATCH);
- if (error == 0)
+ if (error == 0) {
error = vn_setlabel(nd.ni_vp, intlabel,
td->td_ucred);
- vn_finished_write(mp);
+ vn_finished_write(mp);
+ }
}
NDFREE(&nd, 0);
@@ -1122,10 +1123,11 @@ __mac_set_link(struct thread *td, struct __mac_set_link_args *uap)
vfslocked = NDHASGIANT(&nd);
if (error == 0) {
error = vn_start_write(nd.ni_vp, &mp, V_WAIT | PCATCH);
- if (error == 0)
+ if (error == 0) {
error = vn_setlabel(nd.ni_vp, intlabel,
td->td_ucred);
- vn_finished_write(mp);
+ vn_finished_write(mp);
+ }
}
NDFREE(&nd, 0);
OpenPOWER on IntegriCloud