Commit a73bed98 authored by Chuck Lever's avatar Chuck Lever

NFSD: Replace READ* macros in nfsd4_decode_putfh()

Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
parent dca71651
...@@ -1190,16 +1190,21 @@ nfsd4_decode_open_downgrade(struct nfsd4_compoundargs *argp, struct nfsd4_open_d ...@@ -1190,16 +1190,21 @@ nfsd4_decode_open_downgrade(struct nfsd4_compoundargs *argp, struct nfsd4_open_d
static __be32 static __be32
nfsd4_decode_putfh(struct nfsd4_compoundargs *argp, struct nfsd4_putfh *putfh) nfsd4_decode_putfh(struct nfsd4_compoundargs *argp, struct nfsd4_putfh *putfh)
{ {
DECODE_HEAD; __be32 *p;
READ_BUF(4); if (xdr_stream_decode_u32(argp->xdr, &putfh->pf_fhlen) < 0)
putfh->pf_fhlen = be32_to_cpup(p++); return nfserr_bad_xdr;
if (putfh->pf_fhlen > NFS4_FHSIZE) if (putfh->pf_fhlen > NFS4_FHSIZE)
goto xdr_error; return nfserr_bad_xdr;
READ_BUF(putfh->pf_fhlen); p = xdr_inline_decode(argp->xdr, putfh->pf_fhlen);
SAVEMEM(putfh->pf_fhval, putfh->pf_fhlen); if (!p)
return nfserr_bad_xdr;
putfh->pf_fhval = svcxdr_tmpalloc(argp, putfh->pf_fhlen);
if (!putfh->pf_fhval)
return nfserr_jukebox;
memcpy(putfh->pf_fhval, p, putfh->pf_fhlen);
DECODE_TAIL; return nfs_ok;
} }
static __be32 static __be32
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment