From 99d240ec37397536063ecdea5644c8ef759c3e9a Mon Sep 17 00:00:00 2001 From: Andy Fiddaman Date: Wed, 21 Apr 2021 13:53:47 +0000 Subject: 13739 vnode reference leak in copen() Reviewed by: Jason King Reviewed by: Mike Zeller Reviewed by: Igor Kozhukhov Reviewed by: Andrew Stormont Approved by: Dan McDonald --- usr/src/uts/common/syscall/open.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'usr/src') diff --git a/usr/src/uts/common/syscall/open.c b/usr/src/uts/common/syscall/open.c index edb04c824b..40d9717a5b 100644 --- a/usr/src/uts/common/syscall/open.c +++ b/usr/src/uts/common/syscall/open.c @@ -24,10 +24,11 @@ */ /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */ -/* All Rights Reserved */ +/* All Rights Reserved */ /* * Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved. + * Copyright 2021 OmniOS Community Edition (OmniOSce) Association. */ /* * Portions of this source code were derived from Berkeley 4.3 BSD @@ -116,11 +117,11 @@ copen(int startfd, char *fname, int filemode, int createmode) if (filemode & FXATTRDIROPEN) { if (auditing && startvp != NULL) audit_setfsat_path(1); - if (error = lookupnameat(fname, seg, FOLLOW, - NULLVPP, &vp, startvp)) - return (set_errno(error)); + error = lookupnameat(fname, seg, FOLLOW, NULLVPP, &vp, startvp); if (startvp != NULL) VN_RELE(startvp); + if (error != 0) + return (set_errno(error)); startvp = vp; } -- cgit v1.2.3