Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/nfs fix error handling in nfsrv_rename(): when the first...



details:   https://anonhg.NetBSD.org/src/rev/bee26b63264b
branches:  trunk
changeset: 781213:bee26b63264b
user:      chs <chs%NetBSD.org@localhost>
date:      Mon Aug 27 11:35:13 2012 +0000

description:
fix error handling in nfsrv_rename(): when the first nfs_namei() fails,
don't try to free the resources allocated by a successful lookup.

diffstat:

 sys/nfs/nfs_serv.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r b4b7e4505da9 -r bee26b63264b sys/nfs/nfs_serv.c
--- a/sys/nfs/nfs_serv.c        Mon Aug 27 03:18:12 2012 +0000
+++ b/sys/nfs/nfs_serv.c        Mon Aug 27 11:35:13 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nfs_serv.c,v 1.163 2012/02/01 02:27:24 matt Exp $      */
+/*     $NetBSD: nfs_serv.c,v 1.164 2012/08/27 11:35:13 chs Exp $       */
 
 /*
  * Copyright (c) 1989, 1993
@@ -55,7 +55,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nfs_serv.c,v 1.163 2012/02/01 02:27:24 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfs_serv.c,v 1.164 2012/08/27 11:35:13 chs Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1931,6 +1931,7 @@
                        VOP_UNLOCK(fdirp);
        }
        if (error) {
+               fromnd.ni_cnd.cn_nameiop = 0;
                nfsm_reply(2 * NFSX_WCCDATA(v3));
                nfsm_srvwcc_data(fdirfor_ret, &fdirfor, fdiraft_ret, &fdiraft);
                nfsm_srvwcc_data(tdirfor_ret, &tdirfor, tdiraft_ret, &tdiraft);



Home | Main Index | Thread Index | Old Index