diff options
author | Bret Lambert <blambert@cvs.openbsd.org> | 2009-08-09 15:13:49 +0000 |
---|---|---|
committer | Bret Lambert <blambert@cvs.openbsd.org> | 2009-08-09 15:13:49 +0000 |
commit | 11294ffc596a1c7c2dace6cbcebcd85a96267133 (patch) | |
tree | 5e537ec885945ac61d7c326d16df78874bc01fa7 /sys | |
parent | 545a73d899717a303b1977cc4b82567b65c2e570 (diff) |
error = operation();
memory = malloc();
if (error) free(memory);
makes no sense; move error checking to above memory allocation
ok thib@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/nfs/nfs_serv.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/sys/nfs/nfs_serv.c b/sys/nfs/nfs_serv.c index 618e03ea08c..73e77900ad1 100644 --- a/sys/nfs/nfs_serv.c +++ b/sys/nfs/nfs_serv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_serv.c,v 1.79 2009/08/09 13:34:41 thib Exp $ */ +/* $OpenBSD: nfs_serv.c,v 1.80 2009/08/09 15:13:48 blambert Exp $ */ /* $NetBSD: nfs_serv.c,v 1.34 1997/05/12 23:37:12 fvdl Exp $ */ /* @@ -464,6 +464,13 @@ nfsrv_readlink(nfsd, slp, procp, mrq) fhp = &nfh.fh_generic; nfsm_srvmtofh(fhp); + error = nfsrv_fhtovp(fhp, 1, &vp, cred, slp, nam, &rdonly); + if (error) { + nfsm_reply(2 * NFSX_UNSIGNED); + nfsm_srvpostop_attr(nfsd, 1, NULL, &info.nmi_mb); + error = 0; + goto nfsmout; + } len = 0; i = 0; while (len < NFS_MAXPATHLEN) { @@ -493,14 +500,6 @@ nfsrv_readlink(nfsd, slp, procp, mrq) uiop->uio_rw = UIO_READ; uiop->uio_segflg = UIO_SYSSPACE; uiop->uio_procp = NULL; - error = nfsrv_fhtovp(fhp, 1, &vp, cred, slp, nam, &rdonly); - if (error) { - m_freem(mp3); - nfsm_reply(2 * NFSX_UNSIGNED); - nfsm_srvpostop_attr(nfsd, 1, NULL, &info.nmi_mb); - error = 0; - goto nfsmout; - } if (vp->v_type != VLNK) { if (info.nmi_v3) error = EINVAL; |