summaryrefslogtreecommitdiff
path: root/fs/nfs/nfs4xdr.c
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2015-01-23 19:04:44 -0500
committerTrond Myklebust <trond.myklebust@primarydata.com>2015-01-23 23:06:45 -0500
commita67964197c946adbb14d91c3d878af22de47091c (patch)
tree8996c288bf2614957663ed1fa83d782ef5fe8ea7 /fs/nfs/nfs4xdr.c
parentbadc76dd0dc6d55a86c79e952f19d3af24708058 (diff)
downloadlwn-a67964197c946adbb14d91c3d878af22de47091c.tar.gz
lwn-a67964197c946adbb14d91c3d878af22de47091c.zip
NFSv4: Check for NULL argument in nfs_*_seqid() functions
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/nfs4xdr.c')
-rw-r--r--fs/nfs/nfs4xdr.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index 7e7be5ab70bb..d05fada4929c 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -946,7 +946,10 @@ static void encode_uint64(struct xdr_stream *xdr, u64 n)
static void encode_nfs4_seqid(struct xdr_stream *xdr,
const struct nfs_seqid *seqid)
{
- encode_uint32(xdr, seqid->sequence->counter);
+ if (seqid != NULL)
+ encode_uint32(xdr, seqid->sequence->counter);
+ else
+ encode_uint32(xdr, 0);
}
static void encode_compound_hdr(struct xdr_stream *xdr,